home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / QuickTimeComponents.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  148KB  |  3,546 lines

  1. /*
  2.      File:        QuickTimeComponents.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __QUICKTIMECOMPONENTS__
  19. #define __QUICKTIMECOMPONENTS__
  20.  
  21. #ifndef __COMPONENTS__
  22. #include <Components.h>
  23. #endif
  24. #ifndef __IMAGECOMPRESSION__
  25. #include <ImageCompression.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKDRAW__
  31. #include <Quickdraw.h>
  32. #endif
  33. #ifndef __VIDEO__
  34. #include <Video.h>
  35. #endif
  36. #ifndef __MEMORY__
  37. #include <Memory.h>
  38. #endif
  39. #ifndef __SOUND__
  40. #include <Sound.h>
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT_SUPPORTED
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  56.  
  57. enum {
  58.     clockComponentType            = 'clok',
  59.     systemTickClock                = 'tick',                        /* subtype: 60ths since boot        */
  60.     systemSecondClock            = 'seco',                        /* subtype: seconds since 1904        */
  61.     systemMillisecondClock        = 'mill',                        /* subtype: 1000ths since boot        */
  62.     systemMicrosecondClock        = 'micr'                        /* subtype: 1000000ths since boot    */
  63. };
  64.  
  65.  
  66. enum {
  67.     kClockRateIsLinear            = 1,
  68.     kClockImplementsCallBacks    = 2
  69. };
  70.  
  71. #if OLDROUTINENAMES
  72. #define GetClockTime(aClock, out) ClockGetTime(aClock, out)
  73. #endif
  74. /** These are Clock procedures **/
  75. extern pascal ComponentResult ClockGetTime(ComponentInstance aClock, TimeRecord *out)
  76.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  77.  
  78. extern pascal QTCallBack ClockNewCallBack(ComponentInstance aClock, TimeBase tb, short callBackType)
  79.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);
  80.  
  81. extern pascal ComponentResult ClockDisposeCallBack(ComponentInstance aClock, QTCallBack cb)
  82.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  83.  
  84. extern pascal ComponentResult ClockCallMeWhen(ComponentInstance aClock, QTCallBack cb, long param1, long param2, long param3)
  85.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0004, 0x7000, 0xA82A);
  86.  
  87. extern pascal ComponentResult ClockCancelCallBack(ComponentInstance aClock, QTCallBack cb)
  88.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  89.  
  90. extern pascal ComponentResult ClockRateChanged(ComponentInstance aClock, QTCallBack cb)
  91.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  92.  
  93. extern pascal ComponentResult ClockTimeChanged(ComponentInstance aClock, QTCallBack cb)
  94.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  95.  
  96. extern pascal ComponentResult ClockSetTimeBase(ComponentInstance aClock, TimeBase tb)
  97.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  98.  
  99. extern pascal ComponentResult ClockStartStopChanged(ComponentInstance aClock, QTCallBack cb, Boolean startChanged, Boolean stopChanged)
  100.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0009, 0x7000, 0xA82A);
  101.  
  102. extern pascal ComponentResult ClockGetRate(ComponentInstance aClock, Fixed *rate)
  103.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  104.  
  105.  
  106. enum {
  107.     kClockGetTimeSelect            = 0x01,
  108.     kClockNewCallBackSelect        = 0x02,
  109.     kClockDisposeCallBackSelect    = 0x03,
  110.     kClockCallMeWhenSelect        = 0x04,
  111.     kClockCancelCallBackSelect    = 0x05,
  112.     kClockRateChangedSelect        = 0x06,
  113.     kClockTimeChangedSelect        = 0x07,
  114.     kClockSetTimeBaseSelect        = 0x08,
  115.     kClockStartStopChangedSelect = 0x09,
  116.     kClockGetRateSelect            = 0x0A
  117. };
  118.  
  119. /*
  120.     General Sequence Grab stuff
  121. */
  122. typedef ComponentInstance SeqGrabComponent;
  123. typedef ComponentInstance SGChannel;
  124.  
  125. enum {
  126.     SeqGrabComponentType        = 'barg',
  127.     SeqGrabChannelType            = 'sgch',
  128.     SeqGrabPanelType            = 'sgpn',
  129.     SeqGrabCompressionPanelType    = 'cmpr',
  130.     SeqGrabSourcePanelType        = 'sour'
  131. };
  132.  
  133.  
  134. enum {
  135.     seqGrabToDisk                = 1,
  136.     seqGrabToMemory                = 2,
  137.     seqGrabDontUseTempMemory    = 4,
  138.     seqGrabAppendToFile            = 8,
  139.     seqGrabDontAddMovieResource    = 16,
  140.     seqGrabDontMakeMovie        = 32,
  141.     seqGrabPreExtendFile        = 64,
  142.     seqGrabDataProcIsInterruptSafe = 128,
  143.     seqGrabDataProcDoesOverlappingReads = 256
  144. };
  145.  
  146. typedef unsigned long SeqGrabDataOutputEnum;
  147.  
  148. enum {
  149.     seqGrabRecord                = 1,
  150.     seqGrabPreview                = 2,
  151.     seqGrabPlayDuringRecord        = 4
  152. };
  153.  
  154. typedef unsigned long SeqGrabUsageEnum;
  155.  
  156. enum {
  157.     seqGrabHasBounds            = 1,
  158.     seqGrabHasVolume            = 2,
  159.     seqGrabHasDiscreteSamples    = 4
  160. };
  161.  
  162. typedef unsigned long SeqGrabChannelInfoEnum;
  163. struct SeqGrabFrameInfo {
  164.     long                             frameOffset;
  165.     long                             frameTime;
  166.     long                             frameSize;
  167.     SGChannel                         frameChannel;
  168.     long                             frameRefCon;
  169. };
  170. typedef struct SeqGrabFrameInfo SeqGrabFrameInfo;
  171.  
  172. typedef SeqGrabFrameInfo *SeqGrabFrameInfoPtr;
  173.  
  174. enum {
  175.     grabPictOffScreen            = 1,
  176.     grabPictIgnoreClip            = 2,
  177.     grabPictCurrentImage        = 4
  178. };
  179.  
  180.  
  181. enum {
  182.     sgFlagControlledGrab        = (1 << 0)
  183. };
  184.  
  185. typedef pascal OSErr (*SGDataProcPtr)(SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon);
  186.  
  187. #if GENERATINGCFM
  188. typedef UniversalProcPtr SGDataUPP;
  189. #else
  190. typedef SGDataProcPtr SGDataUPP;
  191. #endif
  192. struct SGDeviceName {
  193.     Str63                             name;
  194.     Handle                             icon;
  195.     long                             flags;
  196.     long                             refCon;
  197.     long                             reserved;                    /* zero*/
  198. };
  199. typedef struct SGDeviceName SGDeviceName;
  200.  
  201.  
  202. enum {
  203.     sgDeviceNameFlagDeviceUnavailable = (1 << 0)
  204. };
  205.  
  206. struct SGDeviceListRecord {
  207.     short                             count;
  208.     short                             selectedIndex;
  209.     long                             reserved;                    /* zero*/
  210.     SGDeviceName                     entry[1];
  211. };
  212. typedef struct SGDeviceListRecord SGDeviceListRecord;
  213.  
  214. typedef SGDeviceListRecord *SGDeviceListPtr;
  215. typedef SGDeviceListPtr *SGDeviceList;
  216.  
  217. enum {
  218.     sgDeviceListWithIcons        = (1 << 0),
  219.     sgDeviceListDontCheckAvailability = (1 << 1)
  220. };
  221.  
  222.  
  223. enum {
  224.     seqGrabWriteAppend            = 0,
  225.     seqGrabWriteReserve            = 1,
  226.     seqGrabWriteFill            = 2
  227. };
  228.  
  229.  
  230. enum {
  231.     seqGrabUnpause                = 0,
  232.     seqGrabPause                = 1,
  233.     seqGrabPauseForMenu            = 3
  234. };
  235.  
  236.  
  237. enum {
  238.     channelFlagDontOpenResFile    = 2,
  239.     channelFlagHasDependency    = 4
  240. };
  241.  
  242. typedef pascal Boolean (*SGModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit, long refCon);
  243.  
  244. #if GENERATINGCFM
  245. typedef UniversalProcPtr SGModalFilterUPP;
  246. #else
  247. typedef SGModalFilterProcPtr SGModalFilterUPP;
  248. #endif
  249.  
  250. enum {
  251.     sgPanelFlagForPanel            = 1
  252. };
  253.  
  254.  
  255. enum {
  256.     seqGrabSettingsPreviewOnly    = 1
  257. };
  258.  
  259. struct SGOutputRecord {
  260.     long                             data[1];
  261. };
  262. typedef struct SGOutputRecord SGOutputRecord;
  263.  
  264. typedef SGOutputRecord *SGOutput;
  265.  
  266. enum {
  267.     channelPlayNormal            = 0,
  268.     channelPlayFast                = 1,
  269.     channelPlayHighQuality        = 2,
  270.     channelPlayAllData            = 4
  271. };
  272.  
  273. extern pascal ComponentResult SGInitialize(SeqGrabComponent s)
  274.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0001, 0x7000, 0xA82A);
  275.  
  276. extern pascal ComponentResult SGSetDataOutput(SeqGrabComponent s, const FSSpec *movieFile, long whereFlags)
  277.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  278.  
  279. extern pascal ComponentResult SGGetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long *whereFlags)
  280.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  281.  
  282. extern pascal ComponentResult SGSetGWorld(SeqGrabComponent s, CGrafPtr gp, GDHandle gd)
  283.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  284.  
  285. extern pascal ComponentResult SGGetGWorld(SeqGrabComponent s, CGrafPtr *gp, GDHandle *gd)
  286.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);
  287.  
  288. extern pascal ComponentResult SGNewChannel(SeqGrabComponent s, OSType channelType, SGChannel *ref)
  289.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  290.  
  291. extern pascal ComponentResult SGDisposeChannel(SeqGrabComponent s, SGChannel c)
  292.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  293.  
  294. extern pascal ComponentResult SGStartPreview(SeqGrabComponent s)
  295.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0010, 0x7000, 0xA82A);
  296.  
  297. extern pascal ComponentResult SGStartRecord(SeqGrabComponent s)
  298.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  299.  
  300. extern pascal ComponentResult SGIdle(SeqGrabComponent s)
  301.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  302.  
  303. extern pascal ComponentResult SGStop(SeqGrabComponent s)
  304.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  305.  
  306. extern pascal ComponentResult SGPause(SeqGrabComponent s, Byte pause)
  307.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0014, 0x7000, 0xA82A);
  308.  
  309. extern pascal ComponentResult SGPrepare(SeqGrabComponent s, Boolean prepareForPreview, Boolean prepareForRecord)
  310.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  311.  
  312. extern pascal ComponentResult SGRelease(SeqGrabComponent s)
  313.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0016, 0x7000, 0xA82A);
  314.  
  315. extern pascal Movie SGGetMovie(SeqGrabComponent s)
  316.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  317.  
  318. extern pascal ComponentResult SGSetMaximumRecordTime(SeqGrabComponent s, unsigned long ticks)
  319.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  320.  
  321. extern pascal ComponentResult SGGetMaximumRecordTime(SeqGrabComponent s, unsigned long *ticks)
  322.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  323.  
  324. extern pascal ComponentResult SGGetStorageSpaceRemaining(SeqGrabComponent s, unsigned long *bytes)
  325.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  326.  
  327. extern pascal ComponentResult SGGetTimeRemaining(SeqGrabComponent s, long *ticksLeft)
  328.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  329.  
  330. extern pascal ComponentResult SGGrabPict(SeqGrabComponent s, PicHandle *p, const Rect *bounds, short offscreenDepth, long grabPictFlags)
  331.  FIVEWORDINLINE(0x2F3C, 0x000E, 0x001C, 0x7000, 0xA82A);
  332.  
  333. extern pascal ComponentResult SGGetLastMovieResID(SeqGrabComponent s, short *resID)
  334.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001D, 0x7000, 0xA82A);
  335.  
  336. extern pascal ComponentResult SGSetFlags(SeqGrabComponent s, long sgFlags)
  337.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001E, 0x7000, 0xA82A);
  338.  
  339. extern pascal ComponentResult SGGetFlags(SeqGrabComponent s, long *sgFlags)
  340.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001F, 0x7000, 0xA82A);
  341.  
  342. extern pascal ComponentResult SGSetDataProc(SeqGrabComponent s, SGDataUPP proc, long refCon)
  343.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0020, 0x7000, 0xA82A);
  344.  
  345. extern pascal ComponentResult SGNewChannelFromComponent(SeqGrabComponent s, SGChannel *newChannel, Component sgChannelComponent)
  346.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  347.  
  348. extern pascal ComponentResult SGDisposeDeviceList(SeqGrabComponent s, SGDeviceList list)
  349.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0022, 0x7000, 0xA82A);
  350.  
  351. #endif
  352. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  353. extern pascal ComponentResult SGAppendDeviceListToMenu(SeqGrabComponent s, SGDeviceList list, MenuHandle mh)
  354.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  355.  
  356. #endif
  357. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  358. extern pascal ComponentResult SGSetSettings(SeqGrabComponent s, UserData ud, long flags)
  359.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  360.  
  361. extern pascal ComponentResult SGGetSettings(SeqGrabComponent s, UserData *ud, long flags)
  362.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0025, 0x7000, 0xA82A);
  363.  
  364. extern pascal ComponentResult SGGetIndChannel(SeqGrabComponent s, short index, SGChannel *ref, OSType *chanType)
  365.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0026, 0x7000, 0xA82A);
  366.  
  367. extern pascal ComponentResult SGUpdate(SeqGrabComponent s, RgnHandle updateRgn)
  368.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0027, 0x7000, 0xA82A);
  369.  
  370. extern pascal ComponentResult SGGetPause(SeqGrabComponent s, Byte *paused)
  371.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0028, 0x7000, 0xA82A);
  372.  
  373. extern pascal ComponentResult SGSettingsDialog(SeqGrabComponent s, SGChannel c, short numPanels, Component *panelList, long flags, SGModalFilterUPP proc, long procRefNum)
  374.  FIVEWORDINLINE(0x2F3C, 0x0016, 0x0029, 0x7000, 0xA82A);
  375.  
  376. extern pascal ComponentResult SGGetAlignmentProc(SeqGrabComponent s, ICMAlignmentProcRecordPtr alignmentProc)
  377.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  378.  
  379. extern pascal ComponentResult SGSetChannelSettings(SeqGrabComponent s, SGChannel c, UserData ud, long flags)
  380.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002B, 0x7000, 0xA82A);
  381.  
  382. extern pascal ComponentResult SGGetChannelSettings(SeqGrabComponent s, SGChannel c, UserData *ud, long flags)
  383.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002C, 0x7000, 0xA82A);
  384.  
  385. extern pascal ComponentResult SGGetMode(SeqGrabComponent s, Boolean *previewMode, Boolean *recordMode)
  386.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  387.  
  388. extern pascal ComponentResult SGSetDataRef(SeqGrabComponent s, Handle dataRef, OSType dataRefType, long whereFlags)
  389.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  390.  
  391. extern pascal ComponentResult SGGetDataRef(SeqGrabComponent s, Handle *dataRef, OSType *dataRefType, long *whereFlags)
  392.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002F, 0x7000, 0xA82A);
  393.  
  394. extern pascal ComponentResult SGNewOutput(SeqGrabComponent s, Handle dataRef, OSType dataRefType, long whereFlags, SGOutput *seqOutput)
  395.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0030, 0x7000, 0xA82A);
  396.  
  397. extern pascal ComponentResult SGDisposeOutput(SeqGrabComponent s, SGOutput seqOutput)
  398.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0031, 0x7000, 0xA82A);
  399.  
  400. extern pascal ComponentResult SGSetOutputFlags(SeqGrabComponent s, SGOutput seqOutput, long whereFlags)
  401.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  402.  
  403. extern pascal ComponentResult SGSetChannelOutput(SeqGrabComponent s, SGChannel c, SGOutput seqOutput)
  404.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  405.  
  406. extern pascal ComponentResult SGGetDataOutputStorageSpaceRemaining(SeqGrabComponent s, SGOutput seqOutput, unsigned long *space)
  407.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0034, 0x7000, 0xA82A);
  408.  
  409. /*
  410.     calls from Channel to seqGrab
  411. */
  412. extern pascal ComponentResult SGWriteMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset)
  413.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0100, 0x7000, 0xA82A);
  414.  
  415. extern pascal ComponentResult SGAddFrameReference(SeqGrabComponent s, SeqGrabFrameInfoPtr frameInfo)
  416.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  417.  
  418. extern pascal ComponentResult SGGetNextFrameReference(SeqGrabComponent s, SeqGrabFrameInfoPtr frameInfo, TimeValue *frameDuration, long *frameNumber)
  419.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0102, 0x7000, 0xA82A);
  420.  
  421. extern pascal ComponentResult SGGetTimeBase(SeqGrabComponent s, TimeBase *tb)
  422.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  423.  
  424. extern pascal ComponentResult SGSortDeviceList(SeqGrabComponent s, SGDeviceList list)
  425.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0104, 0x7000, 0xA82A);
  426.  
  427. extern pascal ComponentResult SGAddMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType)
  428.  FIVEWORDINLINE(0x2F3C, 0x001A, 0x0105, 0x7000, 0xA82A);
  429.  
  430. extern pascal ComponentResult SGChangedSource(SeqGrabComponent s, SGChannel c)
  431.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0106, 0x7000, 0xA82A);
  432.  
  433. /*** Sequence Grab CHANNEL Component Stuff ***/
  434. extern pascal ComponentResult SGSetChannelUsage(SGChannel c, long usage)
  435.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0080, 0x7000, 0xA82A);
  436.  
  437. extern pascal ComponentResult SGGetChannelUsage(SGChannel c, long *usage)
  438.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0081, 0x7000, 0xA82A);
  439.  
  440. extern pascal ComponentResult SGSetChannelBounds(SGChannel c, const Rect *bounds)
  441.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0082, 0x7000, 0xA82A);
  442.  
  443. extern pascal ComponentResult SGGetChannelBounds(SGChannel c, Rect *bounds)
  444.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0083, 0x7000, 0xA82A);
  445.  
  446. extern pascal ComponentResult SGSetChannelVolume(SGChannel c, short volume)
  447.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0084, 0x7000, 0xA82A);
  448.  
  449. extern pascal ComponentResult SGGetChannelVolume(SGChannel c, short *volume)
  450.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0085, 0x7000, 0xA82A);
  451.  
  452. extern pascal ComponentResult SGGetChannelInfo(SGChannel c, long *channelInfo)
  453.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0086, 0x7000, 0xA82A);
  454.  
  455. extern pascal ComponentResult SGSetChannelPlayFlags(SGChannel c, long playFlags)
  456.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0087, 0x7000, 0xA82A);
  457.  
  458. extern pascal ComponentResult SGGetChannelPlayFlags(SGChannel c, long *playFlags)
  459.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0088, 0x7000, 0xA82A);
  460.  
  461. extern pascal ComponentResult SGSetChannelMaxFrames(SGChannel c, long frameCount)
  462.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0089, 0x7000, 0xA82A);
  463.  
  464. extern pascal ComponentResult SGGetChannelMaxFrames(SGChannel c, long *frameCount)
  465.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x008A, 0x7000, 0xA82A);
  466.  
  467. extern pascal ComponentResult SGSetChannelRefCon(SGChannel c, long refCon)
  468.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x008B, 0x7000, 0xA82A);
  469.  
  470. extern pascal ComponentResult SGSetChannelClip(SGChannel c, RgnHandle theClip)
  471.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x008C, 0x7000, 0xA82A);
  472.  
  473. extern pascal ComponentResult SGGetChannelClip(SGChannel c, RgnHandle *theClip)
  474.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x008D, 0x7000, 0xA82A);
  475.  
  476. extern pascal ComponentResult SGGetChannelSampleDescription(SGChannel c, Handle sampleDesc)
  477.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x008E, 0x7000, 0xA82A);
  478.  
  479. extern pascal ComponentResult SGGetChannelDeviceList(SGChannel c, long selectionFlags, SGDeviceList *list)
  480.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x008F, 0x7000, 0xA82A);
  481.  
  482. extern pascal ComponentResult SGSetChannelDevice(SGChannel c, StringPtr name)
  483.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0090, 0x7000, 0xA82A);
  484.  
  485. extern pascal ComponentResult SGSetChannelMatrix(SGChannel c, const MatrixRecord *m)
  486.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0091, 0x7000, 0xA82A);
  487.  
  488. extern pascal ComponentResult SGGetChannelMatrix(SGChannel c, MatrixRecord *m)
  489.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0092, 0x7000, 0xA82A);
  490.  
  491. extern pascal ComponentResult SGGetChannelTimeScale(SGChannel c, TimeScale *scale)
  492.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0093, 0x7000, 0xA82A);
  493.  
  494. extern pascal ComponentResult SGChannelPutPicture(SGChannel c)
  495.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0094, 0x7000, 0xA82A);
  496.  
  497. extern pascal ComponentResult SGChannelSetRequestedDataRate(SGChannel c, long bytesPerSecond)
  498.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0095, 0x7000, 0xA82A);
  499.  
  500. extern pascal ComponentResult SGChannelGetRequestedDataRate(SGChannel c, long *bytesPerSecond)
  501.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0096, 0x7000, 0xA82A);
  502.  
  503. extern pascal ComponentResult SGChannelSetDataSourceName(SGChannel c, ConstStr255Param name, ScriptCode scriptTag)
  504.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0097, 0x7000, 0xA82A);
  505.  
  506. extern pascal ComponentResult SGChannelGetDataSourceName(SGChannel c, Str255 name, ScriptCode *scriptTag)
  507.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0098, 0x7000, 0xA82A);
  508.  
  509. /*
  510.     calls from seqGrab to Channel
  511. */
  512. extern pascal ComponentResult SGInitChannel(SGChannel c, SeqGrabComponent owner)
  513.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0180, 0x7000, 0xA82A);
  514.  
  515. extern pascal ComponentResult SGWriteSamples(SGChannel c, Movie m, AliasHandle theFile)
  516.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0181, 0x7000, 0xA82A);
  517.  
  518. extern pascal ComponentResult SGGetDataRate(SGChannel c, long *bytesPerSecond)
  519.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0182, 0x7000, 0xA82A);
  520.  
  521. extern pascal ComponentResult SGAlignChannelRect(SGChannel c, Rect *r)
  522.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0183, 0x7000, 0xA82A);
  523.  
  524. /*
  525.     Dorky dialog panel calls
  526. */
  527. extern pascal ComponentResult SGPanelGetDitl(SeqGrabComponent s, Handle *ditl)
  528.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  529.  
  530. extern pascal ComponentResult SGPanelGetTitle(SeqGrabComponent s, Str255 title)
  531.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0201, 0x7000, 0xA82A);
  532.  
  533. extern pascal ComponentResult SGPanelCanRun(SeqGrabComponent s, SGChannel c)
  534.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0202, 0x7000, 0xA82A);
  535.  
  536. extern pascal ComponentResult SGPanelInstall(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)
  537.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0203, 0x7000, 0xA82A);
  538.  
  539. extern pascal ComponentResult SGPanelEvent(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset, EventRecord *theEvent, short *itemHit, Boolean *handled)
  540.  FIVEWORDINLINE(0x2F3C, 0x0016, 0x0204, 0x7000, 0xA82A);
  541.  
  542. extern pascal ComponentResult SGPanelItem(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset, short itemNum)
  543.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  544.  
  545. extern pascal ComponentResult SGPanelRemove(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)
  546.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0206, 0x7000, 0xA82A);
  547.  
  548. extern pascal ComponentResult SGPanelSetGrabber(SeqGrabComponent s, SeqGrabComponent sg)
  549.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0207, 0x7000, 0xA82A);
  550.  
  551. extern pascal ComponentResult SGPanelSetResFile(SeqGrabComponent s, short resRef)
  552.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0208, 0x7000, 0xA82A);
  553.  
  554. extern pascal ComponentResult SGPanelGetSettings(SeqGrabComponent s, SGChannel c, UserData *ud, long flags)
  555.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0209, 0x7000, 0xA82A);
  556.  
  557. extern pascal ComponentResult SGPanelSetSettings(SeqGrabComponent s, SGChannel c, UserData ud, long flags)
  558.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x020A, 0x7000, 0xA82A);
  559.  
  560. extern pascal ComponentResult SGPanelValidateInput(SeqGrabComponent s, Boolean *ok)
  561.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x020B, 0x7000, 0xA82A);
  562.  
  563. extern pascal ComponentResult SGPanelSetEventFilter(SeqGrabComponent s, SGModalFilterUPP proc, long refCon)
  564.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x020C, 0x7000, 0xA82A);
  565.  
  566. /*** Sequence Grab VIDEO CHANNEL Component Stuff ***/
  567. /*
  568.     Video stuff
  569. */
  570. struct SGCompressInfo {
  571.     Ptr                             buffer;
  572.     unsigned long                     bufferSize;
  573.     UInt8                             similarity;
  574.     UInt8                             reserved;
  575. };
  576. typedef struct SGCompressInfo SGCompressInfo;
  577.  
  578. typedef pascal ComponentResult (*SGGrabProcPtr)(SGChannel c, short bufferNum, long refCon);
  579. typedef pascal ComponentResult (*SGGrabCompleteProcPtr)(SGChannel c, short bufferNum, Boolean *done, long refCon);
  580. typedef pascal ComponentResult (*SGDisplayProcPtr)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  581. typedef pascal ComponentResult (*SGCompressProcPtr)(SGChannel c, short bufferNum, long refCon);
  582. typedef pascal ComponentResult (*SGCompressCompleteProcPtr)(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci, long refCon);
  583. typedef pascal ComponentResult (*SGAddFrameProcPtr)(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci, long refCon);
  584. typedef pascal ComponentResult (*SGTransferFrameProcPtr)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  585. typedef pascal ComponentResult (*SGGrabCompressCompleteProcPtr)(SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *t, long refCon);
  586. typedef pascal ComponentResult (*SGDisplayCompressProcPtr)(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  587.  
  588. #if GENERATINGCFM
  589. typedef UniversalProcPtr SGGrabUPP;
  590. typedef UniversalProcPtr SGGrabCompleteUPP;
  591. typedef UniversalProcPtr SGDisplayUPP;
  592. typedef UniversalProcPtr SGCompressUPP;
  593. typedef UniversalProcPtr SGCompressCompleteUPP;
  594. typedef UniversalProcPtr SGAddFrameUPP;
  595. typedef UniversalProcPtr SGTransferFrameUPP;
  596. typedef UniversalProcPtr SGGrabCompressCompleteUPP;
  597. typedef UniversalProcPtr SGDisplayCompressUPP;
  598. #else
  599. typedef SGGrabProcPtr SGGrabUPP;
  600. typedef SGGrabCompleteProcPtr SGGrabCompleteUPP;
  601. typedef SGDisplayProcPtr SGDisplayUPP;
  602. typedef SGCompressProcPtr SGCompressUPP;
  603. typedef SGCompressCompleteProcPtr SGCompressCompleteUPP;
  604. typedef SGAddFrameProcPtr SGAddFrameUPP;
  605. typedef SGTransferFrameProcPtr SGTransferFrameUPP;
  606. typedef SGGrabCompressCompleteProcPtr SGGrabCompressCompleteUPP;
  607. typedef SGDisplayCompressProcPtr SGDisplayCompressUPP;
  608. #endif
  609. struct VideoBottles {
  610.     short                             procCount;
  611.     SGGrabUPP                         grabProc;
  612.     SGGrabCompleteUPP                 grabCompleteProc;
  613.     SGDisplayUPP                     displayProc;
  614.     SGCompressUPP                     compressProc;
  615.     SGCompressCompleteUPP             compressCompleteProc;
  616.     SGAddFrameUPP                     addFrameProc;
  617.     SGTransferFrameUPP                 transferFrameProc;
  618.     SGGrabCompressCompleteUPP         grabCompressCompleteProc;
  619.     SGDisplayCompressUPP             displayCompressProc;
  620. };
  621. typedef struct VideoBottles VideoBottles;
  622.  
  623. extern pascal ComponentResult SGGetSrcVideoBounds(SGChannel c, Rect *r)
  624.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0100, 0x7000, 0xA82A);
  625.  
  626. extern pascal ComponentResult SGSetVideoRect(SGChannel c, const Rect *r)
  627.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  628.  
  629. extern pascal ComponentResult SGGetVideoRect(SGChannel c, Rect *r)
  630.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  631.  
  632. extern pascal ComponentResult SGGetVideoCompressorType(SGChannel c, OSType *compressorType)
  633.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  634.  
  635. extern pascal ComponentResult SGSetVideoCompressorType(SGChannel c, OSType compressorType)
  636.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0104, 0x7000, 0xA82A);
  637.  
  638. extern pascal ComponentResult SGSetVideoCompressor(SGChannel c, short depth, CompressorComponent compressor, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)
  639.  FIVEWORDINLINE(0x2F3C, 0x0012, 0x0105, 0x7000, 0xA82A);
  640.  
  641. extern pascal ComponentResult SGGetVideoCompressor(SGChannel c, short *depth, CompressorComponent *compressor, CodecQ *spatialQuality, CodecQ *temporalQuality, long *keyFrameRate)
  642.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0106, 0x7000, 0xA82A);
  643.  
  644. extern pascal ComponentInstance SGGetVideoDigitizerComponent(SGChannel c)
  645.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0107, 0x7000, 0xA82A);
  646.  
  647. extern pascal ComponentResult SGSetVideoDigitizerComponent(SGChannel c, ComponentInstance vdig)
  648.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0108, 0x7000, 0xA82A);
  649.  
  650. extern pascal ComponentResult SGVideoDigitizerChanged(SGChannel c)
  651.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0109, 0x7000, 0xA82A);
  652.  
  653. extern pascal ComponentResult SGSetVideoBottlenecks(SGChannel c, VideoBottles *vb)
  654.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x010A, 0x7000, 0xA82A);
  655.  
  656. extern pascal ComponentResult SGGetVideoBottlenecks(SGChannel c, VideoBottles *vb)
  657.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x010B, 0x7000, 0xA82A);
  658.  
  659. extern pascal ComponentResult SGGrabFrame(SGChannel c, short bufferNum)
  660.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x010C, 0x7000, 0xA82A);
  661.  
  662. extern pascal ComponentResult SGGrabFrameComplete(SGChannel c, short bufferNum, Boolean *done)
  663.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x010D, 0x7000, 0xA82A);
  664.  
  665. extern pascal ComponentResult SGDisplayFrame(SGChannel c, short bufferNum, const MatrixRecord *mp, RgnHandle clipRgn)
  666.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x010E, 0x7000, 0xA82A);
  667.  
  668. extern pascal ComponentResult SGCompressFrame(SGChannel c, short bufferNum)
  669.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x010F, 0x7000, 0xA82A);
  670.  
  671. extern pascal ComponentResult SGCompressFrameComplete(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci)
  672.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0110, 0x7000, 0xA82A);
  673.  
  674. extern pascal ComponentResult SGAddFrame(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci)
  675.  FIVEWORDINLINE(0x2F3C, 0x000E, 0x0111, 0x7000, 0xA82A);
  676.  
  677. extern pascal ComponentResult SGTransferFrameForCompress(SGChannel c, short bufferNum, const MatrixRecord *mp, RgnHandle clipRgn)
  678.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0112, 0x7000, 0xA82A);
  679.  
  680. extern pascal ComponentResult SGSetCompressBuffer(SGChannel c, short depth, const Rect *compressSize)
  681.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0113, 0x7000, 0xA82A);
  682.  
  683. extern pascal ComponentResult SGGetCompressBuffer(SGChannel c, short *depth, Rect *compressSize)
  684.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0114, 0x7000, 0xA82A);
  685.  
  686. extern pascal ComponentResult SGGetBufferInfo(SGChannel c, short bufferNum, PixMapHandle *bufferPM, Rect *bufferRect, GWorldPtr *compressBuffer, Rect *compressBufferRect)
  687.  FIVEWORDINLINE(0x2F3C, 0x0012, 0x0115, 0x7000, 0xA82A);
  688.  
  689. extern pascal ComponentResult SGSetUseScreenBuffer(SGChannel c, Boolean useScreenBuffer)
  690.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0116, 0x7000, 0xA82A);
  691.  
  692. extern pascal ComponentResult SGGetUseScreenBuffer(SGChannel c, Boolean *useScreenBuffer)
  693.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0117, 0x7000, 0xA82A);
  694.  
  695. extern pascal ComponentResult SGGrabCompressComplete(SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *tr)
  696.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0118, 0x7000, 0xA82A);
  697.  
  698. extern pascal ComponentResult SGDisplayCompress(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn)
  699.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0119, 0x7000, 0xA82A);
  700.  
  701. extern pascal ComponentResult SGSetFrameRate(SGChannel c, Fixed frameRate)
  702.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x011A, 0x7000, 0xA82A);
  703.  
  704. extern pascal ComponentResult SGGetFrameRate(SGChannel c, Fixed *frameRate)
  705.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x011B, 0x7000, 0xA82A);
  706.  
  707. /*** Sequence Grab SOUND CHANNEL Component Stuff ***/
  708. /*
  709.     Sound stuff
  710. */
  711. extern pascal ComponentResult SGSetSoundInputDriver(SGChannel c, ConstStr255Param driverName)
  712.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0100, 0x7000, 0xA82A);
  713.  
  714. extern pascal long SGGetSoundInputDriver(SGChannel c)
  715.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0101, 0x7000, 0xA82A);
  716.  
  717. extern pascal ComponentResult SGSoundInputDriverChanged(SGChannel c)
  718.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0102, 0x7000, 0xA82A);
  719.  
  720. extern pascal ComponentResult SGSetSoundRecordChunkSize(SGChannel c, long seconds)
  721.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  722.  
  723. extern pascal long SGGetSoundRecordChunkSize(SGChannel c)
  724.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0104, 0x7000, 0xA82A);
  725.  
  726. extern pascal ComponentResult SGSetSoundInputRate(SGChannel c, Fixed rate)
  727.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0105, 0x7000, 0xA82A);
  728.  
  729. extern pascal Fixed SGGetSoundInputRate(SGChannel c)
  730.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0106, 0x7000, 0xA82A);
  731.  
  732. extern pascal ComponentResult SGSetSoundInputParameters(SGChannel c, short sampleSize, short numChannels, OSType compressionType)
  733.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0107, 0x7000, 0xA82A);
  734.  
  735. extern pascal ComponentResult SGGetSoundInputParameters(SGChannel c, short *sampleSize, short *numChannels, OSType *compressionType)
  736.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0108, 0x7000, 0xA82A);
  737.  
  738.  
  739. enum {
  740.     sgChannelAtom                = 'chan',
  741.     sgChannelSettingsAtom        = 'ctom',
  742.     sgChannelDescription        = 'cdsc',
  743.     sgChannelSettings            = 'cset'
  744. };
  745.  
  746.  
  747. enum {
  748.     sgDeviceNameType            = 'name',
  749.     sgUsageType                    = 'use ',
  750.     sgPlayFlagsType                = 'plyf',
  751.     sgClipType                    = 'clip',
  752.     sgMatrixType                = 'mtrx',
  753.     sgVolumeType                = 'volu'
  754. };
  755.  
  756.  
  757. enum {
  758.     sgPanelSettingsAtom            = 'ptom',
  759.     sgPanelDescription            = 'pdsc',
  760.     sgPanelSettings                = 'pset'
  761. };
  762.  
  763.  
  764. enum {
  765.     sgcSoundCompressionType        = 'scmp',
  766.     sgcSoundSampleRateType        = 'srat',
  767.     sgcSoundChannelCountType    = 'schn',
  768.     sgcSoundSampleSizeType        = 'ssiz',
  769.     sgcSoundInputType            = 'sinp',
  770.     sgcSoundGainType            = 'gain'
  771. };
  772.  
  773.  
  774. enum {
  775.     sgcVideoHueType                = 'hue ',
  776.     sgcVideoSaturationType        = 'satr',
  777.     sgcVideoContrastType        = 'trst',
  778.     sgcVideoSharpnessType        = 'shrp',
  779.     sgcVideoBrigtnessType        = 'brit',
  780.     sgcVideoBlackLevelType        = 'blkl',
  781.     sgcVideoWhiteLevelType        = 'whtl',
  782.     sgcVideoInputType            = 'vinp',
  783.     sgcVideoFormatType            = 'vstd',
  784.     sgcVideoFilterType            = 'vflt',
  785.     sgcVideoRectType            = 'vrct',
  786.     sgVideoDigitizerType        = 'vdig'
  787. };
  788.  
  789.  
  790. enum {
  791.     kSGInitializeSelect            = 0x01,
  792.     kSGSetDataOutputSelect        = 0x02,
  793.     kSGGetDataOutputSelect        = 0x03,
  794.     kSGSetGWorldSelect            = 0x04,
  795.     kSGGetGWorldSelect            = 0x05,
  796.     kSGNewChannelSelect            = 0x06,
  797.     kSGDisposeChannelSelect        = 0x07,
  798.     kSGStartPreviewSelect        = 0x10,
  799.     kSGStartRecordSelect        = 0x11,
  800.     kSGIdleSelect                = 0x12,
  801.     kSGStopSelect                = 0x13,
  802.     kSGPauseSelect                = 0x14,
  803.     kSGPrepareSelect            = 0x15,
  804.     kSGReleaseSelect            = 0x16,
  805.     kSGGetMovieSelect            = 0x17,
  806.     kSGSetMaximumRecordTimeSelect = 0x18,
  807.     kSGGetMaximumRecordTimeSelect = 0x19,
  808.     kSGGetStorageSpaceRemainingSelect = 0x1A,
  809.     kSGGetTimeRemainingSelect    = 0x1B,
  810.     kSGGrabPictSelect            = 0x1C,
  811.     kSGGetLastMovieResIDSelect    = 0x1D,
  812.     kSGSetFlagsSelect            = 0x1E,
  813.     kSGGetFlagsSelect            = 0x1F,
  814.     kSGSetDataProcSelect        = 0x20,
  815.     kSGNewChannelFromComponentSelect = 0x21,
  816.     kSGDisposeDeviceListSelect    = 0x22,
  817.     kSGAppendDeviceListToMenuSelect = 0x23,
  818.     kSGSetSettingsSelect        = 0x24,
  819.     kSGGetSettingsSelect        = 0x25,
  820.     kSGGetIndChannelSelect        = 0x26,
  821.     kSGUpdateSelect                = 0x27,
  822.     kSGGetPauseSelect            = 0x28,
  823.     kSGSettingsDialogSelect        = 0x29,
  824.     kSGGetAlignmentProcSelect    = 0x2A,
  825.     kSGSetChannelSettingsSelect    = 0x2B,
  826.     kSGGetChannelSettingsSelect    = 0x2C,
  827.     kSGGetModeSelect            = 0x2D,
  828.     kSGSetDataRefSelect            = 0x2E,
  829.     kSGGetDataRefSelect            = 0x2F,
  830.     kSGNewOutputSelect            = 0x30,
  831.     kSGDisposeOutputSelect        = 0x31,
  832.     kSGSetOutputFlagsSelect        = 0x32,
  833.     kSGSetChannelOutputSelect    = 0x33,
  834.     kSGGetDataOutputStorageSpaceRemainingSelect = 0x34,
  835.     kSGWriteMovieDataSelect        = 0x0100,
  836.     kSGAddFrameReferenceSelect    = 0x0101,
  837.     kSGGetNextFrameReferenceSelect = 0x0102,
  838.     kSGGetTimeBaseSelect        = 0x0103,
  839.     kSGSortDeviceListSelect        = 0x0104,
  840.     kSGAddMovieDataSelect        = 0x0105,
  841.     kSGChangedSourceSelect        = 0x0106,
  842.     kSGCSetChannelUsageSelect    = 0x80,
  843.     kSGCGetChannelUsageSelect    = 0x81,
  844.     kSGCSetChannelBoundsSelect    = 0x82,
  845.     kSGCGetChannelBoundsSelect    = 0x83,
  846.     kSGCSetChannelVolumeSelect    = 0x84,
  847.     kSGCGetChannelVolumeSelect    = 0x85,
  848.     kSGCGetChannelInfoSelect    = 0x86,
  849.     kSGCSetChannelPlayFlagsSelect = 0x87,
  850.     kSGCGetChannelPlayFlagsSelect = 0x88,
  851.     kSGCSetChannelMaxFramesSelect = 0x89,
  852.     kSGCGetChannelMaxFramesSelect = 0x8A,
  853.     kSGCSetChannelRefConSelect    = 0x8B,
  854.     kSGCSetChannelClipSelect    = 0x8C,
  855.     kSGCGetChannelClipSelect    = 0x8D,
  856.     kSGCGetChannelSampleDescriptionSelect = 0x8E,
  857.     kSGCGetChannelDeviceListSelect = 0x8F,
  858.     kSGCSetChannelDeviceSelect    = 0x90,
  859.     kSGCSetChannelMatrixSelect    = 0x91,
  860.     kSGCGetChannelMatrixSelect    = 0x92,
  861.     kSGCGetChannelTimeScaleSelect = 0x93,
  862.     kSGCChannelPutPictureSelect    = 0x94,
  863.     kSGCChannelSetRequestedDataRateSelect = 0x95,
  864.     kSGCChannelGetRequestedDataRateSelect = 0x96,
  865.     kSGCChannelSetDataSourceNameSelect = 0x97,
  866.     kSGCChannelGetDataSourceNameSelect = 0x98,
  867.     kSGCInitChannelSelect        = 0x0180,
  868.     kSGCWriteSamplesSelect        = 0x0181,
  869.     kSGCGetDataRateSelect        = 0x0182,
  870.     kSGCAlignChannelRectSelect    = 0x0183,
  871.     kSGCPanelGetDitlSelect        = 0x0200,
  872.     kSGCPanelGetTitleSelect        = 0x0201,
  873.     kSGCPanelCanRunSelect        = 0x0202,
  874.     kSGCPanelInstallSelect        = 0x0203,
  875.     kSGCPanelEventSelect        = 0x0204,
  876.     kSGCPanelItemSelect            = 0x0205,
  877.     kSGCPanelRemoveSelect        = 0x0206,
  878.     kSGCPanelSetGrabberSelect    = 0x0207,
  879.     kSGCPanelSetResFileSelect    = 0x0208,
  880.     kSGCPanelGetSettingsSelect    = 0x0209,
  881.     kSGCPanelSetSettingsSelect    = 0x020A,
  882.     kSGCPanelValidateInputSelect = 0x020B,
  883.     kSGCPanelSetEventFilterSelect = 0x020C,
  884.     kSGCGetSrcVideoBoundsSelect    = 0x0100,
  885.     kSGCSetVideoRectSelect        = 0x0101,
  886.     kSGCGetVideoRectSelect        = 0x0102,
  887.     kSGCGetVideoCompressorTypeSelect = 0x0103,
  888.     kSGCSetVideoCompressorTypeSelect = 0x0104,
  889.     kSGCSetVideoCompressorSelect = 0x0105,
  890.     kSGCGetVideoCompressorSelect = 0x0106,
  891.     kSGCGetVideoDigitizerComponentSelect = 0x0107,
  892.     kSGCSetVideoDigitizerComponentSelect = 0x0108,
  893.     kSGCVideoDigitizerChangedSelect = 0x0109,
  894.     kSGCSetVideoBottlenecksSelect = 0x010A,
  895.     kSGCGetVideoBottlenecksSelect = 0x010B,
  896.     kSGCGrabFrameSelect            = 0x010C,
  897.     kSGCGrabFrameCompleteSelect    = 0x010D,
  898.     kSGCDisplayFrameSelect        = 0x010E,
  899.     kSGCCompressFrameSelect        = 0x010F,
  900.     kSGCCompressFrameCompleteSelect = 0x0110,
  901.     kSGCAddFrameSelect            = 0x0111,
  902.     kSGCTransferFrameForCompressSelect = 0x0112,
  903.     kSGCSetCompressBufferSelect    = 0x0113,
  904.     kSGCGetCompressBufferSelect    = 0x0114,
  905.     kSGCGetBufferInfoSelect        = 0x0115,
  906.     kSGCSetUseScreenBufferSelect = 0x0116,
  907.     kSGCGetUseScreenBufferSelect = 0x0117,
  908.     kSGCGrabCompressCompleteSelect = 0x0118,
  909.     kSGCDisplayCompressSelect    = 0x0119,
  910.     kSGCSetFrameRateSelect        = 0x011A,
  911.     kSGCGetFrameRateSelect        = 0x011B,
  912.     kSGCSetSoundInputDriverSelect = 0x0100,
  913.     kSGCGetSoundInputDriverSelect = 0x0101,
  914.     kSGCSoundInputDriverChangedSelect = 0x0102,
  915.     kSGCSetSoundRecordChunkSizeSelect = 0x0103,
  916.     kSGCGetSoundRecordChunkSizeSelect = 0x0104,
  917.     kSGCSetSoundInputRateSelect    = 0x0105,
  918.     kSGCGetSoundInputRateSelect    = 0x0106,
  919.     kSGCSetSoundInputParametersSelect = 0x0107,
  920.     kSGCGetSoundInputParametersSelect = 0x0108
  921. };
  922.  
  923. /* Standard type for video digitizers */
  924.  
  925. enum {
  926.     videoDigitizerComponentType    = 'vdig',
  927.     vdigInterfaceRev            = 2
  928. };
  929.  
  930. /* Input Format Standards */
  931.  
  932. enum {
  933.     ntscIn                        = 0,                            /* current input format */
  934.     currentIn                    = 0,                            /* ntsc input format */
  935.     palIn                        = 1,                            /* pal input format */
  936.     secamIn                        = 2,                            /* secam input format */
  937.     ntscReallyIn                = 3                                /* ntsc input format */
  938. };
  939.  
  940. /* Input Formats */
  941.  
  942. enum {
  943.     compositeIn                    = 0,                            /* input is composite format */
  944.     sVideoIn                    = 1,                            /* input is sVideo format */
  945.     rgbComponentIn                = 2,                            /* input is rgb component format */
  946.     rgbComponentSyncIn            = 3,                            /* input is rgb component format (sync on green?)*/
  947.     yuvComponentIn                = 4,                            /* input is yuv component format */
  948.     yuvComponentSyncIn            = 5,                            /* input is yuv component format (sync on green?) */
  949.     tvTunerIn                    = 6
  950. };
  951.  
  952. /* Video Digitizer PlayThru States */
  953.  
  954. enum {
  955.     vdPlayThruOff                = 0,
  956.     vdPlayThruOn                = 1
  957. };
  958.  
  959. /* Input Color Space Modes */
  960.  
  961. enum {
  962.     vdDigitizerBW                = 0,                            /* black and white */
  963.     vdDigitizerRGB                = 1                                /* rgb color */
  964. };
  965.  
  966. /* Phase Lock Loop Modes */
  967.  
  968. enum {
  969.     vdBroadcastMode                = 0,                            /* Broadcast / Laser Disk video mode */
  970.     vdVTRMode                    = 1                                /* VCR / Magnetic media mode */
  971. };
  972.  
  973. /* Field Select Options */
  974.  
  975. enum {
  976.     vdUseAnyField                = 0,                            /* Digitizers choice on field use */
  977.     vdUseOddField                = 1,                            /* Use odd field for half size vert and smaller */
  978.     vdUseEvenField                = 2                                /* Use even field for half size vert and smaller */
  979. };
  980.  
  981. /* vdig types */
  982.  
  983. enum {
  984.     vdTypeBasic                    = 0,                            /* basic, no clipping */
  985.     vdTypeAlpha                    = 1,                            /* supports clipping with alpha channel */
  986.     vdTypeMask                    = 2,                            /* supports clipping with mask plane */
  987.     vdTypeKey                    = 3                                /* supports clipping with key color(s) */
  988. };
  989.  
  990. /* Digitizer Input Capability/Current Flags    */
  991.  
  992. enum {
  993.     digiInDoesNTSC                = 1L << 0,                        /* digitizer supports NTSC input format */
  994.     digiInDoesPAL                = 1L << 1,                        /* digitizer supports PAL input format */
  995.     digiInDoesSECAM                = 1L << 2,                        /* digitizer supports SECAM input format */
  996.     digiInDoesGenLock            = 1L << 7,                        /* digitizer does genlock */
  997.     digiInDoesComposite            = 1L << 8,                        /* digitizer supports composite input type */
  998.     digiInDoesSVideo            = 1L << 9,                        /* digitizer supports S-Video input type */
  999.     digiInDoesComponent            = 1L << 10,                        /* digitizer supports component = rgb, input type */
  1000.     digiInVTR_Broadcast            = 1L << 11,                        /* digitizer can differentiate between the two */
  1001.     digiInDoesColor                = 1L << 12,                        /* digitizer supports color */
  1002.     digiInDoesBW                = 1L << 13,                        /* digitizer supports black & white */
  1003.                                                                 /* Digitizer Input Current Flags = these are valid only during active operating conditions,    */
  1004.     digiInSignalLock            = 1L << 31                        /* digitizer detects input signal is locked, this bit = horiz lock || vertical lock */
  1005. };
  1006.  
  1007. /* Digitizer Output Capability/Current Flags */
  1008.  
  1009. enum {
  1010.     digiOutDoes1                = 1L << 0,                        /* digitizer supports 1 bit pixels */
  1011.     digiOutDoes2                = 1L << 1,                        /* digitizer supports 2 bit pixels */
  1012.     digiOutDoes4                = 1L << 2,                        /* digitizer supports 4 bit pixels */
  1013.     digiOutDoes8                = 1L << 3,                        /* digitizer supports 8 bit pixels */
  1014.     digiOutDoes16                = 1L << 4,                        /* digitizer supports 16 bit pixels */
  1015.     digiOutDoes32                = 1L << 5,                        /* digitizer supports 32 bit pixels */
  1016.     digiOutDoesDither            = 1L << 6,                        /* digitizer dithers in indexed modes */
  1017.     digiOutDoesStretch            = 1L << 7,                        /* digitizer can arbitrarily stretch */
  1018.     digiOutDoesShrink            = 1L << 8,                        /* digitizer can arbitrarily shrink */
  1019.     digiOutDoesMask                = 1L << 9,                        /* digitizer can mask to clipping regions */
  1020.     digiOutDoesDouble            = 1L << 11,                        /* digitizer can stretch to exactly double size */
  1021.     digiOutDoesQuad                = 1L << 12,                        /* digitizer can stretch exactly quadruple size */
  1022.     digiOutDoesQuarter            = 1L << 13,                        /* digitizer can shrink to exactly quarter size */
  1023.     digiOutDoesSixteenth        = 1L << 14,                        /* digitizer can shrink to exactly sixteenth size */
  1024.     digiOutDoesRotate            = 1L << 15,                        /* digitizer supports rotate transformations */
  1025.     digiOutDoesHorizFlip        = 1L << 16,                        /* digitizer supports horizontal flips Sx < 0 */
  1026.     digiOutDoesVertFlip            = 1L << 17,                        /* digitizer supports vertical flips Sy < 0 */
  1027.     digiOutDoesSkew                = 1L << 18,                        /* digitizer supports skew = shear,twist, */
  1028.     digiOutDoesBlend            = 1L << 19,
  1029.     digiOutDoesWarp                = 1L << 20,
  1030.     digiOutDoesHW_DMA            = 1L << 21,                        /* digitizer not constrained to local device */
  1031.     digiOutDoesHWPlayThru        = 1L << 22,                        /* digitizer doesn't need time to play thru */
  1032.     digiOutDoesILUT                = 1L << 23,                        /* digitizer does inverse LUT for index modes */
  1033.     digiOutDoesKeyColor            = 1L << 24,                        /* digitizer does key color functions too */
  1034.     digiOutDoesAsyncGrabs        = 1L << 25,                        /* digitizer supports async grabs */
  1035.     digiOutDoesUnreadableScreenBits = 1L << 26,                    /* playthru doesn't generate readable bits on screen*/
  1036.     digiOutDoesCompress            = 1L << 27,                        /* supports alternate output data types */
  1037.     digiOutDoesCompressOnly        = 1L << 28,                        /* can't provide raw frames anywhere */
  1038.     digiOutDoesPlayThruDuringCompress = 1L << 29                /* digi can do playthru while providing compressed data */
  1039. };
  1040.  
  1041. /* Types */
  1042. typedef ComponentInstance VideoDigitizerComponent;
  1043. typedef ComponentResult VideoDigitizerError;
  1044. struct DigitizerInfo {
  1045.     short                             vdigType;
  1046.     long                             inputCapabilityFlags;
  1047.     long                             outputCapabilityFlags;
  1048.     long                             inputCurrentFlags;
  1049.     long                             outputCurrentFlags;
  1050.     short                             slot;                        /* temporary for connection purposes */
  1051.     GDHandle                         gdh;                        /* temporary for digitizers that have preferred screen */
  1052.     GDHandle                         maskgdh;                    /* temporary for digitizers that have mask planes */
  1053.     short                             minDestHeight;                /* Smallest resizable height */
  1054.     short                             minDestWidth;                /* Smallest resizable width */
  1055.     short                             maxDestHeight;                /* Largest resizable height */
  1056.     short                             maxDestWidth;                /* Largest resizable height */
  1057.     short                             blendLevels;                /* Number of blend levels supported (2 if 1 bit mask) */
  1058.     long                             reserved;                    /* reserved */
  1059. };
  1060. typedef struct DigitizerInfo DigitizerInfo;
  1061.  
  1062. struct VdigType {
  1063.     long                             digType;
  1064.     long                             reserved;
  1065. };
  1066. typedef struct VdigType VdigType;
  1067.  
  1068. struct VdigTypeList {
  1069.     short                             count;
  1070.     VdigType                         list[1];
  1071. };
  1072. typedef struct VdigTypeList VdigTypeList;
  1073.  
  1074. struct VdigBufferRec {
  1075.     PixMapHandle                     dest;
  1076.     Point                             location;
  1077.     long                             reserved;
  1078. };
  1079. typedef struct VdigBufferRec VdigBufferRec;
  1080.  
  1081. struct VdigBufferRecList {
  1082.     short                             count;
  1083.     MatrixRecordPtr                 matrix;
  1084.     RgnHandle                         mask;
  1085.     VdigBufferRec                     list[1];
  1086. };
  1087. typedef struct VdigBufferRecList VdigBufferRecList;
  1088.  
  1089. typedef VdigBufferRecList *VdigBufferRecListPtr;
  1090. typedef VdigBufferRecListPtr *VdigBufferRecListHandle;
  1091. typedef pascal void (*VdigIntProcPtr)(long flags, long refcon);
  1092.  
  1093. #if GENERATINGCFM
  1094. typedef UniversalProcPtr VdigIntUPP;
  1095. #else
  1096. typedef VdigIntProcPtr VdigIntUPP;
  1097. #endif
  1098. struct VDCompressionList {
  1099.     CodecComponent                     codec;
  1100.     CodecType                         cType;
  1101.     Str63                             typeName;
  1102.     Str63                             name;
  1103.     long                             formatFlags;
  1104.     long                             compressFlags;
  1105.     long                             reserved;
  1106. };
  1107. typedef struct VDCompressionList VDCompressionList;
  1108.  
  1109. typedef VDCompressionList *VDCompressionListPtr;
  1110. typedef VDCompressionListPtr *VDCompressionListHandle;
  1111.  
  1112. enum {
  1113.     dmaDepth1                    = 1,
  1114.     dmaDepth2                    = 2,
  1115.     dmaDepth4                    = 4,
  1116.     dmaDepth8                    = 8,
  1117.     dmaDepth16                    = 16,
  1118.     dmaDepth32                    = 32,
  1119.     dmaDepth2Gray                = 64,
  1120.     dmaDepth4Gray                = 128,
  1121.     dmaDepth8Gray                = 256
  1122. };
  1123.  
  1124.  
  1125. enum {
  1126.     kVDIGControlledFrameRate    = -1
  1127. };
  1128.  
  1129. /* number of vdig calls*/
  1130.  
  1131. enum {
  1132.     kvdigSelectors                = 86
  1133. };
  1134.  
  1135. extern pascal VideoDigitizerError VDGetMaxSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *maxSrcRect)
  1136.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0001, 0x7000, 0xA82A);
  1137.  
  1138. extern pascal VideoDigitizerError VDGetActiveSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *activeSrcRect)
  1139.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);
  1140.  
  1141. extern pascal VideoDigitizerError VDSetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)
  1142.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  1143.  
  1144. extern pascal VideoDigitizerError VDGetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)
  1145.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1146.  
  1147. extern pascal VideoDigitizerError VDGetVBlankRect(VideoDigitizerComponent ci, short inputStd, Rect *vBlankRect)
  1148.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0005, 0x7000, 0xA82A);
  1149.  
  1150. extern pascal VideoDigitizerError VDGetMaskPixMap(VideoDigitizerComponent ci, PixMapHandle maskPixMap)
  1151.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1152.  
  1153. extern pascal VideoDigitizerError VDGetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle *dest, Rect *destRect, MatrixRecord *m, RgnHandle *mask)
  1154.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0008, 0x7000, 0xA82A);
  1155.  
  1156. extern pascal VideoDigitizerError VDUseThisCLUT(VideoDigitizerComponent ci, CTabHandle colorTableHandle)
  1157.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);
  1158.  
  1159. extern pascal VideoDigitizerError VDSetInputGammaValue(VideoDigitizerComponent ci, Fixed channel1, Fixed channel2, Fixed channel3)
  1160.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  1161.  
  1162. extern pascal VideoDigitizerError VDGetInputGammaValue(VideoDigitizerComponent ci, Fixed *channel1, Fixed *channel2, Fixed *channel3)
  1163.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000B, 0x7000, 0xA82A);
  1164.  
  1165. extern pascal VideoDigitizerError VDSetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)
  1166.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1167.  
  1168. extern pascal VideoDigitizerError VDGetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)
  1169.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1170.  
  1171. extern pascal VideoDigitizerError VDSetContrast(VideoDigitizerComponent ci, unsigned short *contrast)
  1172.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000E, 0x7000, 0xA82A);
  1173.  
  1174. extern pascal VideoDigitizerError VDSetHue(VideoDigitizerComponent ci, unsigned short *hue)
  1175.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000F, 0x7000, 0xA82A);
  1176.  
  1177. extern pascal VideoDigitizerError VDSetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)
  1178.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1179.  
  1180. extern pascal VideoDigitizerError VDSetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)
  1181.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0011, 0x7000, 0xA82A);
  1182.  
  1183. extern pascal VideoDigitizerError VDGetContrast(VideoDigitizerComponent ci, unsigned short *contrast)
  1184.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  1185.  
  1186. extern pascal VideoDigitizerError VDGetHue(VideoDigitizerComponent ci, unsigned short *hue)
  1187.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0013, 0x7000, 0xA82A);
  1188.  
  1189. extern pascal VideoDigitizerError VDGetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)
  1190.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0014, 0x7000, 0xA82A);
  1191.  
  1192. extern pascal VideoDigitizerError VDGetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)
  1193.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  1194.  
  1195. extern pascal VideoDigitizerError VDGrabOneFrame(VideoDigitizerComponent ci)
  1196.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0016, 0x7000, 0xA82A);
  1197.  
  1198. extern pascal VideoDigitizerError VDGetMaxAuxBuffer(VideoDigitizerComponent ci, PixMapHandle *pm, Rect *r)
  1199.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0017, 0x7000, 0xA82A);
  1200.  
  1201. extern pascal VideoDigitizerError VDGetDigitizerInfo(VideoDigitizerComponent ci, DigitizerInfo *info)
  1202.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  1203.  
  1204. extern pascal VideoDigitizerError VDGetCurrentFlags(VideoDigitizerComponent ci, long *inputCurrentFlag, long *outputCurrentFlag)
  1205.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  1206.  
  1207. extern pascal VideoDigitizerError VDSetKeyColor(VideoDigitizerComponent ci, long index)
  1208.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  1209.  
  1210. extern pascal VideoDigitizerError VDGetKeyColor(VideoDigitizerComponent ci, long *index)
  1211.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001C, 0x7000, 0xA82A);
  1212.  
  1213. extern pascal VideoDigitizerError VDAddKeyColor(VideoDigitizerComponent ci, long *index)
  1214.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001D, 0x7000, 0xA82A);
  1215.  
  1216. extern pascal VideoDigitizerError VDGetNextKeyColor(VideoDigitizerComponent ci, long index)
  1217.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001E, 0x7000, 0xA82A);
  1218.  
  1219. extern pascal VideoDigitizerError VDSetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)
  1220.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001F, 0x7000, 0xA82A);
  1221.  
  1222. extern pascal VideoDigitizerError VDGetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)
  1223.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0020, 0x7000, 0xA82A);
  1224.  
  1225. extern pascal VideoDigitizerError VDSetDigitizerUserInterrupt(VideoDigitizerComponent ci, long flags, VdigIntUPP userInterruptProc, long refcon)
  1226.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0021, 0x7000, 0xA82A);
  1227.  
  1228. extern pascal VideoDigitizerError VDSetInputColorSpaceMode(VideoDigitizerComponent ci, short colorSpaceMode)
  1229.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0022, 0x7000, 0xA82A);
  1230.  
  1231. extern pascal VideoDigitizerError VDGetInputColorSpaceMode(VideoDigitizerComponent ci, short *colorSpaceMode)
  1232.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0023, 0x7000, 0xA82A);
  1233.  
  1234. extern pascal VideoDigitizerError VDSetClipState(VideoDigitizerComponent ci, short clipEnable)
  1235.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0024, 0x7000, 0xA82A);
  1236.  
  1237. extern pascal VideoDigitizerError VDGetClipState(VideoDigitizerComponent ci, short *clipEnable)
  1238.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0025, 0x7000, 0xA82A);
  1239.  
  1240. extern pascal VideoDigitizerError VDSetClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)
  1241.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0026, 0x7000, 0xA82A);
  1242.  
  1243. extern pascal VideoDigitizerError VDClearClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)
  1244.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0027, 0x7000, 0xA82A);
  1245.  
  1246. extern pascal VideoDigitizerError VDGetCLUTInUse(VideoDigitizerComponent ci, CTabHandle *colorTableHandle)
  1247.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0028, 0x7000, 0xA82A);
  1248.  
  1249. extern pascal VideoDigitizerError VDSetPLLFilterType(VideoDigitizerComponent ci, short pllType)
  1250.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0029, 0x7000, 0xA82A);
  1251.  
  1252. extern pascal VideoDigitizerError VDGetPLLFilterType(VideoDigitizerComponent ci, short *pllType)
  1253.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  1254.  
  1255. extern pascal VideoDigitizerError VDGetMaskandValue(VideoDigitizerComponent ci, unsigned short blendLevel, long *mask, long *value)
  1256.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x002B, 0x7000, 0xA82A);
  1257.  
  1258. extern pascal VideoDigitizerError VDSetMasterBlendLevel(VideoDigitizerComponent ci, unsigned short *blendLevel)
  1259.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x002C, 0x7000, 0xA82A);
  1260.  
  1261. extern pascal VideoDigitizerError VDSetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle dest, Rect *destRect, MatrixRecord *m, RgnHandle mask)
  1262.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x002D, 0x7000, 0xA82A);
  1263.  
  1264. extern pascal VideoDigitizerError VDSetPlayThruOnOff(VideoDigitizerComponent ci, short state)
  1265.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x002E, 0x7000, 0xA82A);
  1266.  
  1267. extern pascal VideoDigitizerError VDSetFieldPreference(VideoDigitizerComponent ci, short fieldFlag)
  1268.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x002F, 0x7000, 0xA82A);
  1269.  
  1270. extern pascal VideoDigitizerError VDGetFieldPreference(VideoDigitizerComponent ci, short *fieldFlag)
  1271.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0030, 0x7000, 0xA82A);
  1272.  
  1273. extern pascal VideoDigitizerError VDPreflightDestination(VideoDigitizerComponent ci, Rect *digitizerRect, PixMap **dest, Rect *destRect, MatrixRecord *m)
  1274.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0032, 0x7000, 0xA82A);
  1275.  
  1276. extern pascal VideoDigitizerError VDPreflightGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)
  1277.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  1278.  
  1279. extern pascal VideoDigitizerError VDSetPlayThruGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)
  1280.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0034, 0x7000, 0xA82A);
  1281.  
  1282. extern pascal VideoDigitizerError VDSetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr inputGammaPtr)
  1283.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0035, 0x7000, 0xA82A);
  1284.  
  1285. extern pascal VideoDigitizerError VDGetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr *inputGammaPtr)
  1286.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0036, 0x7000, 0xA82A);
  1287.  
  1288. extern pascal VideoDigitizerError VDSetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)
  1289.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0037, 0x7000, 0xA82A);
  1290.  
  1291. extern pascal VideoDigitizerError VDGetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)
  1292.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0038, 0x7000, 0xA82A);
  1293.  
  1294. extern pascal VideoDigitizerError VDSetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)
  1295.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0039, 0x7000, 0xA82A);
  1296.  
  1297. extern pascal VideoDigitizerError VDGetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)
  1298.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x003A, 0x7000, 0xA82A);
  1299.  
  1300. extern pascal VideoDigitizerError VDGetVideoDefaults(VideoDigitizerComponent ci, unsigned short *blackLevel, unsigned short *whiteLevel, unsigned short *brightness, unsigned short *hue, unsigned short *saturation, unsigned short *contrast, unsigned short *sharpness)
  1301.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x003B, 0x7000, 0xA82A);
  1302.  
  1303. extern pascal VideoDigitizerError VDGetNumberOfInputs(VideoDigitizerComponent ci, short *inputs)
  1304.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x003C, 0x7000, 0xA82A);
  1305.  
  1306. extern pascal VideoDigitizerError VDGetInputFormat(VideoDigitizerComponent ci, short input, short *format)
  1307.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x003D, 0x7000, 0xA82A);
  1308.  
  1309. extern pascal VideoDigitizerError VDSetInput(VideoDigitizerComponent ci, short input)
  1310.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x003E, 0x7000, 0xA82A);
  1311.  
  1312. extern pascal VideoDigitizerError VDGetInput(VideoDigitizerComponent ci, short *input)
  1313.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x003F, 0x7000, 0xA82A);
  1314.  
  1315. extern pascal VideoDigitizerError VDSetInputStandard(VideoDigitizerComponent ci, short inputStandard)
  1316.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0040, 0x7000, 0xA82A);
  1317.  
  1318. extern pascal VideoDigitizerError VDSetupBuffers(VideoDigitizerComponent ci, VdigBufferRecListHandle bufferList)
  1319.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0041, 0x7000, 0xA82A);
  1320.  
  1321. extern pascal VideoDigitizerError VDGrabOneFrameAsync(VideoDigitizerComponent ci, short buffer)
  1322.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0042, 0x7000, 0xA82A);
  1323.  
  1324. extern pascal VideoDigitizerError VDDone(VideoDigitizerComponent ci, short buffer)
  1325.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0043, 0x7000, 0xA82A);
  1326.  
  1327. extern pascal VideoDigitizerError VDSetCompression(VideoDigitizerComponent ci, OSType compressType, short depth, Rect *bounds, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)
  1328.  FIVEWORDINLINE(0x2F3C, 0x0016, 0x0044, 0x7000, 0xA82A);
  1329.  
  1330. extern pascal VideoDigitizerError VDCompressOneFrameAsync(VideoDigitizerComponent ci)
  1331.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0045, 0x7000, 0xA82A);
  1332.  
  1333. extern pascal VideoDigitizerError VDCompressDone(VideoDigitizerComponent ci, Boolean *done, Ptr *theData, long *dataSize, UInt8 *similarity, TimeRecord *t)
  1334.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0046, 0x7000, 0xA82A);
  1335.  
  1336. extern pascal VideoDigitizerError VDReleaseCompressBuffer(VideoDigitizerComponent ci, Ptr bufferAddr)
  1337.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0047, 0x7000, 0xA82A);
  1338.  
  1339. extern pascal VideoDigitizerError VDGetImageDescription(VideoDigitizerComponent ci, ImageDescriptionHandle desc)
  1340.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0048, 0x7000, 0xA82A);
  1341.  
  1342. extern pascal VideoDigitizerError VDResetCompressSequence(VideoDigitizerComponent ci)
  1343.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0049, 0x7000, 0xA82A);
  1344.  
  1345. extern pascal VideoDigitizerError VDSetCompressionOnOff(VideoDigitizerComponent ci, Boolean state)
  1346.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x004A, 0x7000, 0xA82A);
  1347.  
  1348. extern pascal VideoDigitizerError VDGetCompressionTypes(VideoDigitizerComponent ci, VDCompressionListHandle h)
  1349.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x004B, 0x7000, 0xA82A);
  1350.  
  1351. extern pascal VideoDigitizerError VDSetTimeBase(VideoDigitizerComponent ci, TimeBase t)
  1352.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x004C, 0x7000, 0xA82A);
  1353.  
  1354. extern pascal VideoDigitizerError VDSetFrameRate(VideoDigitizerComponent ci, Fixed framesPerSecond)
  1355.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x004D, 0x7000, 0xA82A);
  1356.  
  1357. extern pascal VideoDigitizerError VDGetDataRate(VideoDigitizerComponent ci, long *milliSecPerFrame, Fixed *framesPerSecond, long *bytesPerSecond)
  1358.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x004E, 0x7000, 0xA82A);
  1359.  
  1360. extern pascal VideoDigitizerError VDGetSoundInputDriver(VideoDigitizerComponent ci, Str255 soundDriverName)
  1361.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x004F, 0x7000, 0xA82A);
  1362.  
  1363. extern pascal VideoDigitizerError VDGetDMADepths(VideoDigitizerComponent ci, long *depthArray, long *preferredDepth)
  1364.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0050, 0x7000, 0xA82A);
  1365.  
  1366. extern pascal VideoDigitizerError VDGetPreferredTimeScale(VideoDigitizerComponent ci, TimeScale *preferred)
  1367.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0051, 0x7000, 0xA82A);
  1368.  
  1369. extern pascal VideoDigitizerError VDReleaseAsyncBuffers(VideoDigitizerComponent ci)
  1370.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0052, 0x7000, 0xA82A);
  1371.  
  1372. /* 83 is reserved for compatibility reasons */
  1373. extern pascal VideoDigitizerError VDSetDataRate(VideoDigitizerComponent ci, long bytesPerSecond)
  1374.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0054, 0x7000, 0xA82A);
  1375.  
  1376. extern pascal VideoDigitizerError VDGetTimeCode(VideoDigitizerComponent ci, TimeRecord *atTime, void *timeCodeFormat, void *timeCodeTime)
  1377.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0055, 0x7000, 0xA82A);
  1378.  
  1379. extern pascal VideoDigitizerError VDUseSafeBuffers(VideoDigitizerComponent ci, Boolean useSafeBuffers)
  1380.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0056, 0x7000, 0xA82A);
  1381.  
  1382. extern pascal VideoDigitizerError VDGetSoundInputSource(VideoDigitizerComponent ci, long videoInput, long *soundInput)
  1383.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0057, 0x7000, 0xA82A);
  1384.  
  1385. extern pascal VideoDigitizerError VDGetCompressionTime(VideoDigitizerComponent ci, OSType compressionType, short depth, Rect *srcRect, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *compressTime)
  1386.  FIVEWORDINLINE(0x2F3C, 0x0016, 0x0058, 0x7000, 0xA82A);
  1387.  
  1388.  
  1389. enum {
  1390.     kSelectVDGetMaxSrcRect        = 0x01,
  1391.     kSelectVDGetActiveSrcRect    = 0x02,
  1392.     kSelectVDSetDigitizerRect    = 0x03,
  1393.     kSelectVDGetDigitizerRect    = 0x04,
  1394.     kSelectVDGetVBlankRect        = 0x05,
  1395.     kSelectVDGetMaskPixMap        = 0x06,
  1396.     kSelectVDGetPlayThruDestination = 0x08,
  1397.     kSelectVDUseThisCLUT        = 0x09,
  1398.     kSelectVDSetInputGammaValue    = 0x0A,
  1399.     kSelectVDGetInputGammaValue    = 0x0B,
  1400.     kSelectVDSetBrightness        = 0x0C,
  1401.     kSelectVDGetBrightness        = 0x0D,
  1402.     kSelectVDSetContrast        = 0x0E,
  1403.     kSelectVDSetHue                = 0x0F,
  1404.     kSelectVDSetSharpness        = 0x10,
  1405.     kSelectVDSetSaturation        = 0x11,
  1406.     kSelectVDGetContrast        = 0x12,
  1407.     kSelectVDGetHue                = 0x13,
  1408.     kSelectVDGetSharpness        = 0x14,
  1409.     kSelectVDGetSaturation        = 0x15,
  1410.     kSelectVDGrabOneFrame        = 0x16,
  1411.     kSelectVDGetMaxAuxBuffer    = 0x17,
  1412.     kSelectVDGetDigitizerInfo    = 0x19,
  1413.     kSelectVDGetCurrentFlags    = 0x1A,
  1414.     kSelectVDSetKeyColor        = 0x1B,
  1415.     kSelectVDGetKeyColor        = 0x1C,
  1416.     kSelectVDAddKeyColor        = 0x1D,
  1417.     kSelectVDGetNextKeyColor    = 0x1E,
  1418.     kSelectVDSetKeyColorRange    = 0x1F,
  1419.     kSelectVDGetKeyColorRange    = 0x20,
  1420.     kSelectVDSetDigitizerUserInterrupt = 0x21,
  1421.     kSelectVDSetInputColorSpaceMode = 0x22,
  1422.     kSelectVDGetInputColorSpaceMode = 0x23,
  1423.     kSelectVDSetClipState        = 0x24,
  1424.     kSelectVDGetClipState        = 0x25,
  1425.     kSelectVDSetClipRgn            = 0x26,
  1426.     kSelectVDClearClipRgn        = 0x27,
  1427.     kSelectVDGetCLUTInUse        = 0x28,
  1428.     kSelectVDSetPLLFilterType    = 0x29,
  1429.     kSelectVDGetPLLFilterType    = 0x2A,
  1430.     kSelectVDGetMaskandValue    = 0x2B,
  1431.     kSelectVDSetMasterBlendLevel = 0x2C,
  1432.     kSelectVDSetPlayThruDestination = 0x2D,
  1433.     kSelectVDSetPlayThruOnOff    = 0x2E,
  1434.     kSelectVDSetFieldPreference    = 0x2F,
  1435.     kSelectVDGetFieldPreference    = 0x30,
  1436.     kSelectVDPreflightDestination = 0x32,
  1437.     kSelectVDPreflightGlobalRect = 0x33,
  1438.     kSelectVDSetPlayThruGlobalRect = 0x34,
  1439.     kSelectVDSetInputGammaRecord = 0x35,
  1440.     kSelectVDGetInputGammaRecord = 0x36,
  1441.     kSelectVDSetBlackLevelValue    = 0x37,
  1442.     kSelectVDGetBlackLevelValue    = 0x38,
  1443.     kSelectVDSetWhiteLevelValue    = 0x39,
  1444.     kSelectVDGetWhiteLevelValue    = 0x3A,
  1445.     kSelectVDGetVideoDefaults    = 0x3B,
  1446.     kSelectVDGetNumberOfInputs    = 0x3C,
  1447.     kSelectVDGetInputFormat        = 0x3D,
  1448.     kSelectVDSetInput            = 0x3E,
  1449.     kSelectVDGetInput            = 0x3F,
  1450.     kSelectVDSetInputStandard    = 0x40,
  1451.     kSelectVDSetupBuffers        = 0x41,
  1452.     kSelectVDGrabOneFrameAsync    = 0x42,
  1453.     kSelectVDDone                = 0x43,
  1454.     kSelectVDSetCompression        = 0x44,
  1455.     kSelectVDCompressOneFrameAsync = 0x45,
  1456.     kSelectVDCompressDone        = 0x46,
  1457.     kSelectVDReleaseCompressBuffer = 0x47,
  1458.     kSelectVDGetImageDescription = 0x48,
  1459.     kSelectVDResetCompressSequence = 0x49,
  1460.     kSelectVDSetCompressionOnOff = 0x4A,
  1461.     kSelectVDGetCompressionTypes = 0x4B,
  1462.     kSelectVDSetTimeBase        = 0x4C,
  1463.     kSelectVDSetFrameRate        = 0x4D,
  1464.     kSelectVDGetDataRate        = 0x4E,
  1465.     kSelectVDGetSoundInputDriver = 0x4F,
  1466.     kSelectVDGetDMADepths        = 0x50,
  1467.     kSelectVDGetPreferredTimeScale = 0x51,
  1468.     kSelectVDReleaseAsyncBuffers = 0x52,
  1469.     kSelectVDSetDataRate        = 0x54,
  1470.     kSelectVDGetTimeCode        = 0x55,
  1471.     kSelectVDUseSafeBuffers        = 0x56,
  1472.     kSelectVDGetSoundInputSource = 0x57,
  1473.     kSelectVDGetCompressionTime    = 0x58
  1474. };
  1475.  
  1476.  
  1477. enum {
  1478.     StandardCompressionType        = 'scdi',
  1479.     StandardCompressionSubType    = 'imag'
  1480. };
  1481.  
  1482. typedef pascal Boolean (*SCModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit, long refcon);
  1483. typedef pascal short (*SCModalHookProcPtr)(DialogPtr theDialog, short itemHit, void *params, long refcon);
  1484.  
  1485. #if GENERATINGCFM
  1486. typedef UniversalProcPtr SCModalFilterUPP;
  1487. typedef UniversalProcPtr SCModalHookUPP;
  1488. #else
  1489. typedef SCModalFilterProcPtr SCModalFilterUPP;
  1490. typedef SCModalHookProcPtr SCModalHookUPP;
  1491. #endif
  1492. /*    Preference flags.*/
  1493.  
  1494. enum {
  1495.     scListEveryCodec            = 1L << 1,
  1496.     scAllowZeroFrameRate        = 1L << 2,
  1497.     scAllowZeroKeyFrameRate        = 1L << 3,
  1498.     scShowBestDepth                = 1L << 4,
  1499.     scUseMovableModal            = 1L << 5
  1500. };
  1501.  
  1502. /*    Possible test flags for setting test image.*/
  1503.  
  1504. enum {
  1505.     scPreferCropping            = 1 << 0,
  1506.     scPreferScaling                = 1 << 1,
  1507.     scPreferScalingAndCropping    = scPreferScaling | scPreferCropping
  1508. };
  1509.  
  1510. /*    Dimensions of the image preview box.*/
  1511.  
  1512. enum {
  1513.     scTestImageWidth            = 80,
  1514.     scTestImageHeight            = 80
  1515. };
  1516.  
  1517. /*    Possible items returned by hookProc.*/
  1518.  
  1519. enum {
  1520.     scOKItem                    = 1,
  1521.     scCancelItem                = 2,
  1522.     scCustomItem                = 3
  1523. };
  1524.  
  1525. /*    Result returned when user cancelled.*/
  1526.  
  1527. enum {
  1528.     scUserCancelled                = 1
  1529. };
  1530.  
  1531. /* Component selectors*/
  1532.  
  1533. enum {
  1534.     scPositionRect                = 2,
  1535.     scPositionDialog            = 3,
  1536.     scSetTestImagePictHandle    = 4,
  1537.     scSetTestImagePictFile        = 5,
  1538.     scSetTestImagePixMap        = 6,
  1539.     scGetBestDeviceRect            = 7,
  1540.     scRequestImageSettings        = 10,
  1541.     scCompressImage                = 11,
  1542.     scCompressPicture            = 12,
  1543.     scCompressPictureFile        = 13,
  1544.     scRequestSequenceSettings    = 14,
  1545.     scCompressSequenceBegin        = 15,
  1546.     scCompressSequenceFrame        = 16,
  1547.     scCompressSequenceEnd        = 17,
  1548.     scDefaultPictHandleSettings    = 18,
  1549.     scDefaultPictFileSettings    = 19,
  1550.     scDefaultPixMapSettings        = 20,
  1551.     scGetInfo                    = 21,
  1552.     scSetInfo                    = 22,
  1553.     scNewGWorld                    = 23
  1554. };
  1555.  
  1556. /*    Get/SetInfo structures.*/
  1557. struct SCSpatialSettings {
  1558.     CodecType                         codecType;
  1559.     CodecComponent                     codec;
  1560.     short                             depth;
  1561.     CodecQ                             spatialQuality;
  1562. };
  1563. typedef struct SCSpatialSettings SCSpatialSettings;
  1564.  
  1565. struct SCTemporalSettings {
  1566.     CodecQ                             temporalQuality;
  1567.     Fixed                             frameRate;
  1568.     long                             keyFrameRate;
  1569. };
  1570. typedef struct SCTemporalSettings SCTemporalSettings;
  1571.  
  1572. struct SCDataRateSettings {
  1573.     long                             dataRate;
  1574.     long                             frameDuration;
  1575.     CodecQ                             minSpatialQuality;
  1576.     CodecQ                             minTemporalQuality;
  1577. };
  1578. typedef struct SCDataRateSettings SCDataRateSettings;
  1579.  
  1580. struct SCExtendedProcs {
  1581.     SCModalFilterUPP                 filterProc;
  1582.     SCModalHookUPP                     hookProc;
  1583.     long                             refcon;
  1584.     Str31                             customName;
  1585. };
  1586. typedef struct SCExtendedProcs SCExtendedProcs;
  1587.  
  1588. /*    Get/SetInfo selectors*/
  1589.  
  1590. enum {
  1591.     scSpatialSettingsType        = 'sptl',                        /* pointer to SCSpatialSettings struct*/
  1592.     scTemporalSettingsType        = 'tprl',                        /* pointer to SCTemporalSettings struct*/
  1593.     scDataRateSettingsType        = 'drat',                        /* pointer to SCDataRateSettings struct*/
  1594.     scColorTableType            = 'clut',                        /* pointer to CTabHandle*/
  1595.     scProgressProcType            = 'prog',                        /* pointer to ProgressRecord struct*/
  1596.     scExtendedProcsType            = 'xprc',                        /* pointer to SCExtendedProcs struct*/
  1597.     scPreferenceFlagsType        = 'pref',                        /* pointer to long*/
  1598.     scSettingsStateType            = 'ssta',                        /* pointer to Handle*/
  1599.     scSequenceIDType            = 'sequ',                        /* pointer to ImageSequence*/
  1600.     scWindowPositionType        = 'wndw',                        /* pointer to Point*/
  1601.     scCodecFlagsType            = 'cflg',                        /* pointer to CodecFlags*/
  1602.     scCodecSettingsType            = 'cdec',                        /* pointer to Handle*/
  1603.     scForceKeyValueType            = 'ksim'                        /* pointer to long*/
  1604. };
  1605.  
  1606. /*    scTypeNotFoundErr returned by Get/SetInfo when type cannot be found.*/
  1607. /** These are Progress procedures **/
  1608. extern pascal ComponentResult SCPositionRect(ComponentInstance ci, Rect *rp, Point *where)
  1609.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  1610.  
  1611. extern pascal ComponentResult SCPositionDialog(ComponentInstance ci, short id, Point *where)
  1612.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0003, 0x7000, 0xA82A);
  1613.  
  1614. extern pascal ComponentResult SCSetTestImagePictHandle(ComponentInstance ci, PicHandle testPict, Rect *testRect, short testFlags)
  1615.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0004, 0x7000, 0xA82A);
  1616.  
  1617. extern pascal ComponentResult SCSetTestImagePictFile(ComponentInstance ci, short testFileRef, Rect *testRect, short testFlags)
  1618.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);
  1619.  
  1620. extern pascal ComponentResult SCSetTestImagePixMap(ComponentInstance ci, PixMapHandle testPixMap, Rect *testRect, short testFlags)
  1621.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0006, 0x7000, 0xA82A);
  1622.  
  1623. extern pascal ComponentResult SCGetBestDeviceRect(ComponentInstance ci, Rect *r)
  1624.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1625.  
  1626. extern pascal ComponentResult SCRequestImageSettings(ComponentInstance ci)
  1627.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x000A, 0x7000, 0xA82A);
  1628.  
  1629. extern pascal ComponentResult SCCompressImage(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle *desc, Handle *data)
  1630.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x000B, 0x7000, 0xA82A);
  1631.  
  1632. extern pascal ComponentResult SCCompressPicture(ComponentInstance ci, PicHandle srcPicture, PicHandle dstPicture)
  1633.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000C, 0x7000, 0xA82A);
  1634.  
  1635. extern pascal ComponentResult SCCompressPictureFile(ComponentInstance ci, short srcRefNum, short dstRefNum)
  1636.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1637.  
  1638. extern pascal ComponentResult SCRequestSequenceSettings(ComponentInstance ci)
  1639.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x000E, 0x7000, 0xA82A);
  1640.  
  1641. extern pascal ComponentResult SCCompressSequenceBegin(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle *desc)
  1642.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  1643.  
  1644. extern pascal ComponentResult SCCompressSequenceFrame(ComponentInstance ci, PixMapHandle src, const Rect *srcRect, Handle *data, long *dataSize, short *notSyncFlag)
  1645.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0010, 0x7000, 0xA82A);
  1646.  
  1647. extern pascal ComponentResult SCCompressSequenceEnd(ComponentInstance ci)
  1648.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1649.  
  1650. extern pascal ComponentResult SCDefaultPictHandleSettings(ComponentInstance ci, PicHandle srcPicture, short motion)
  1651.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0012, 0x7000, 0xA82A);
  1652.  
  1653. extern pascal ComponentResult SCDefaultPictFileSettings(ComponentInstance ci, short srcRef, short motion)
  1654.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0013, 0x7000, 0xA82A);
  1655.  
  1656. extern pascal ComponentResult SCDefaultPixMapSettings(ComponentInstance ci, PixMapHandle src, short motion)
  1657.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0014, 0x7000, 0xA82A);
  1658.  
  1659. extern pascal ComponentResult SCGetInfo(ComponentInstance ci, OSType infoType, void *info)
  1660.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  1661.  
  1662. extern pascal ComponentResult SCSetInfo(ComponentInstance ci, OSType infoType, void *info)
  1663.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0016, 0x7000, 0xA82A);
  1664.  
  1665. extern pascal ComponentResult SCNewGWorld(ComponentInstance ci, GWorldPtr *gwp, Rect *rp, GWorldFlags flags)
  1666.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  1667.  
  1668. extern pascal ComponentResult SCSetCompressFlags(ComponentInstance ci, long flags)
  1669.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1670.  
  1671. extern pascal ComponentResult SCGetCompressFlags(ComponentInstance ci, long *flags)
  1672.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  1673.  
  1674. struct SCParams {
  1675.     long                             flags;
  1676.     CodecType                         theCodecType;
  1677.     CodecComponent                     theCodec;
  1678.     CodecQ                             spatialQuality;
  1679.     CodecQ                             temporalQuality;
  1680.     short                             depth;
  1681.     Fixed                             frameRate;
  1682.     long                             keyFrameRate;
  1683.     long                             reserved1;
  1684.     long                             reserved2;
  1685. };
  1686. typedef struct SCParams SCParams;
  1687.  
  1688.  
  1689. enum {
  1690.     scGetCompression            = 1,
  1691.     scShowMotionSettings        = 1L << 0,
  1692.     scSettingsChangedItem        = -1
  1693. };
  1694.  
  1695.  
  1696. enum {
  1697.     scCompressFlagIgnoreIdenticalFrames = 1
  1698. };
  1699.  
  1700. extern pascal ComponentResult SCGetCompressionExtended(ComponentInstance ci, SCParams *params, Point where, SCModalFilterUPP filterProc, SCModalHookUPP hookProc, long refcon, StringPtr customName)
  1701.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0001, 0x7000, 0xA82A);
  1702.  
  1703. #define SCGetCompression(ci, params, where) SCGetCompressionExtended(ci,params,where,0,0,0,0)
  1704.  
  1705. enum {
  1706.     kSCPositionRectSelect        = 0x02,
  1707.     kSCPositionDialogSelect        = 0x03,
  1708.     kSCSetTestImagePictHandleSelect = 0x04,
  1709.     kSCSetTestImagePictFileSelect = 0x05,
  1710.     kSCSetTestImagePixMapSelect    = 0x06,
  1711.     kSCGetBestDeviceRectSelect    = 0x07,
  1712.     kSCRequestImageSettingsSelect = 0x0A,
  1713.     kSCCompressImageSelect        = 0x0B,
  1714.     kSCCompressPictureSelect    = 0x0C,
  1715.     kSCCompressPictureFileSelect = 0x0D,
  1716.     kSCRequestSequenceSettingsSelect = 0x0E,
  1717.     kSCCompressSequenceBeginSelect = 0x0F,
  1718.     kSCCompressSequenceFrameSelect = 0x10,
  1719.     kSCCompressSequenceEndSelect = 0x11,
  1720.     kSCDefaultPictHandleSettingsSelect = 0x12,
  1721.     kSCDefaultPictFileSettingsSelect = 0x13,
  1722.     kSCDefaultPixMapSettingsSelect = 0x14,
  1723.     kSCGetInfoSelect            = 0x15,
  1724.     kSCSetInfoSelect            = 0x16,
  1725.     kSCNewGWorldSelect            = 0x17,
  1726.     kSCSetCompressFlagsSelect    = 0x18,
  1727.     kSCGetCompressFlagsSelect    = 0x19,
  1728.     kSCGetCompressionExtendedSelect = 0x01
  1729. };
  1730.  
  1731. typedef ComponentInstance MovieImportComponent;
  1732. typedef ComponentInstance MovieExportComponent;
  1733.  
  1734. enum {
  1735.     MovieImportType                = 'eat ',
  1736.     MovieExportType                = 'spit'
  1737. };
  1738.  
  1739.  
  1740. enum {
  1741.     canMovieImportHandles        = 1 << 0,
  1742.     canMovieImportFiles            = 1 << 1,
  1743.     hasMovieImportUserInterface    = 1 << 2,
  1744.     canMovieExportHandles        = 1 << 3,
  1745.     canMovieExportFiles            = 1 << 4,
  1746.     hasMovieExportUserInterface    = 1 << 5,
  1747.     dontAutoFileMovieImport        = 1 << 6,
  1748.     canMovieExportAuxDataHandle    = 1 << 7,
  1749.     canMovieImportValidateHandles = 1 << 8,
  1750.     canMovieImportValidateFile    = 1 << 9,
  1751.     dontRegisterWithEasyOpen    = 1 << 10,
  1752.     canMovieImportInPlace        = 1 << 11,
  1753.     movieImportSubTypeIsFileExtension = 1 << 12
  1754. };
  1755.  
  1756.  
  1757. enum {
  1758.     kMovieImportExportOpenSelect = kComponentOpenSelect,
  1759.     kMovieImportExportCloseSelect = kComponentCloseSelect,
  1760.     kMovieImportExportCanDoSelect = kComponentCanDoSelect,
  1761.     kMovieImportExportVersionSelect = kComponentVersionSelect,
  1762.     kMovieImportExportTargetSelect = kComponentTargetSelect,
  1763.     kMovieImportHandleSelect    = 1,
  1764.     kMovieImportFileSelect        = 2,
  1765.     kMovieImportSetSampleDurationSelect = 3,
  1766.     kMovieImportSetSampleDescriptionSelect = 4,
  1767.     kMovieImportSetMediaFileSelect = 5,
  1768.     kMovieImportSetDimensionsSelect = 6,
  1769.     kMovieImportSetChunkSizeSelect = 7,
  1770.     kMovieImportSetProgressProcSelect = 8,
  1771.     kMovieImportSetAuxiliaryDataSelect = 9,
  1772.     kMovieImportSetFromScrapSelect = 10,
  1773.     kMovieImportDoUserDialogSelect = 11,
  1774.     kMovieImportSetDurationSelect = 12,
  1775.     kMovieImportGetAuxiliaryDataTypeSelect = 13,
  1776.     kMovieImportValidateSelect    = 14,
  1777.     kMovieImportGetFileTypeSelect = 15,
  1778.     kMovieExportToHandleSelect    = 128,
  1779.     kMovieExportToFileSelect    = 129,
  1780.     kMovieExportDoUserDialogSelectOBSOLETE = 130,
  1781.     kMovieExportGetAuxiliaryDataSelect = 131,
  1782.     kMovieExportSetProgressProcSelect = 132,
  1783.     kMovieExportSetSampleDescriptionSelect = 133,
  1784.     kMovieExportDoUserDialogSelect = 134,
  1785.     kMovieExportGetCreatorTypeSelect = 135
  1786. };
  1787.  
  1788.  
  1789. enum {
  1790.     movieImportCreateTrack        = 1,
  1791.     movieImportInParallel        = 2,
  1792.     movieImportMustUseTrack        = 4
  1793. };
  1794.  
  1795.  
  1796. enum {
  1797.     movieImportResultUsedMultipleTracks = 8
  1798. };
  1799.  
  1800.  
  1801. enum {
  1802.     kMovieExportTextOnly        = 0,
  1803.     kMovieExportAbsoluteTime    = 1,
  1804.     kMovieExportRelativeTime    = 2
  1805. };
  1806.  
  1807. extern pascal ComponentResult MovieImportHandle(MovieImportComponent ci, Handle dataH, Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration, long inFlags, long *outFlags)
  1808.  FIVEWORDINLINE(0x2F3C, 0x0020, 0x0001, 0x7000, 0xA82A);
  1809.  
  1810. extern pascal ComponentResult MovieImportFile(MovieImportComponent ci, const FSSpec *theFile, Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration, long inFlags, long *outFlags)
  1811.  FIVEWORDINLINE(0x2F3C, 0x0020, 0x0002, 0x7000, 0xA82A);
  1812.  
  1813. extern pascal ComponentResult MovieImportSetSampleDuration(MovieImportComponent ci, TimeValue duration, TimeScale scale)
  1814.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  1815.  
  1816. extern pascal ComponentResult MovieImportSetSampleDescription(MovieImportComponent ci, SampleDescriptionHandle desc, OSType mediaType)
  1817.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1818.  
  1819. extern pascal ComponentResult MovieImportSetMediaFile(MovieImportComponent ci, AliasHandle alias)
  1820.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1821.  
  1822. extern pascal ComponentResult MovieImportSetDimensions(MovieImportComponent ci, Fixed width, Fixed height)
  1823.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  1824.  
  1825. extern pascal ComponentResult MovieImportSetChunkSize(MovieImportComponent ci, long chunkSize)
  1826.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1827.  
  1828. extern pascal ComponentResult MovieImportSetProgressProc(MovieImportComponent ci, MovieProgressUPP proc, long refcon)
  1829.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1830.  
  1831. extern pascal ComponentResult MovieImportSetAuxiliaryData(MovieImportComponent ci, Handle data, OSType handleType)
  1832.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0009, 0x7000, 0xA82A);
  1833.  
  1834. extern pascal ComponentResult MovieImportSetFromScrap(MovieImportComponent ci, Boolean fromScrap)
  1835.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x000A, 0x7000, 0xA82A);
  1836.  
  1837. extern pascal ComponentResult MovieImportDoUserDialog(MovieImportComponent ci, const FSSpec *theFile, Handle theData, Boolean *canceled)
  1838.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000B, 0x7000, 0xA82A);
  1839.  
  1840. extern pascal ComponentResult MovieImportSetDuration(MovieImportComponent ci, TimeValue duration)
  1841.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1842.  
  1843. extern pascal ComponentResult MovieImportGetAuxiliaryDataType(MovieImportComponent ci, OSType *auxType)
  1844.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1845.  
  1846. extern pascal ComponentResult MovieImportValidate(MovieImportComponent ci, const FSSpec *theFile, Handle theData, Boolean *valid)
  1847.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  1848.  
  1849. extern pascal ComponentResult MovieImportGetFileType(MovieImportComponent ci, OSType *fileType)
  1850.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000F, 0x7000, 0xA82A);
  1851.  
  1852. extern pascal ComponentResult MovieExportToHandle(MovieExportComponent ci, Handle dataH, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration)
  1853.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0080, 0x7000, 0xA82A);
  1854.  
  1855. extern pascal ComponentResult MovieExportToFile(MovieExportComponent ci, const FSSpec *theFile, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration)
  1856.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0081, 0x7000, 0xA82A);
  1857.  
  1858. extern pascal ComponentResult MovieExportGetAuxiliaryData(MovieExportComponent ci, Handle dataH, OSType *handleType)
  1859.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0083, 0x7000, 0xA82A);
  1860.  
  1861. extern pascal ComponentResult MovieExportSetProgressProc(MovieExportComponent ci, MovieProgressUPP proc, long refcon)
  1862.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0084, 0x7000, 0xA82A);
  1863.  
  1864. extern pascal ComponentResult MovieExportSetSampleDescription(MovieExportComponent ci, SampleDescriptionHandle desc, OSType mediaType)
  1865.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0085, 0x7000, 0xA82A);
  1866.  
  1867. extern pascal ComponentResult MovieExportDoUserDialog(MovieExportComponent ci, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration, Boolean *canceled)
  1868.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0086, 0x7000, 0xA82A);
  1869.  
  1870. extern pascal ComponentResult MovieExportGetCreatorType(MovieExportComponent ci, OSType *creator)
  1871.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0087, 0x7000, 0xA82A);
  1872.  
  1873. /* Text Export Display Info data structure*/
  1874. struct TextDisplayData {
  1875.     long                             displayFlags;
  1876.     long                             textJustification;
  1877.     RGBColor                         bgColor;
  1878.     Rect                             textBox;
  1879.  
  1880.     short                             beginHilite;
  1881.     short                             endHilite;
  1882.     RGBColor                         hiliteColor;
  1883.     Boolean                         doHiliteColor;
  1884.     SInt8                             filler;
  1885.     TimeValue                         scrollDelayDur;
  1886.     Point                             dropShadowOffset;
  1887.     short                             dropShadowTransparency;
  1888. };
  1889. typedef struct TextDisplayData TextDisplayData;
  1890.  
  1891. typedef ComponentInstance TextExportComponent;
  1892. extern pascal ComponentResult TextExportGetDisplayData(TextExportComponent ci, TextDisplayData *textDisplay)
  1893.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0100, 0x7000, 0xA82A);
  1894.  
  1895. extern pascal ComponentResult TextExportGetTimeFraction(TextExportComponent ci, long *movieTimeFraction)
  1896.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  1897.  
  1898. extern pascal ComponentResult TextExportSetTimeFraction(TextExportComponent ci, long movieTimeFraction)
  1899.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1900.  
  1901. extern pascal ComponentResult TextExportGetSettings(TextExportComponent ci, long *setting)
  1902.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  1903.  
  1904. extern pascal ComponentResult TextExportSetSettings(TextExportComponent ci, long setting)
  1905.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0104, 0x7000, 0xA82A);
  1906.  
  1907. /*
  1908. **************
  1909.  
  1910.     File Preview Components
  1911.  
  1912. **************
  1913. */
  1914. typedef ComponentInstance pnotComponent;
  1915.  
  1916. enum {
  1917.     pnotComponentWantsEvents    = 1,
  1918.     pnotComponentNeedsNoCache    = 2
  1919. };
  1920.  
  1921.  
  1922. enum {
  1923.     kPreviewOpenSelector        = 0,
  1924.     kPreviewCloseSelector        = -1,
  1925.     kPreviewCanDoSelector        = -2,
  1926.     kPreviewVersionSelector        = -3,
  1927.     kPreviewShowDataSelector    = 1,
  1928.     kPreviewMakePreviewSelector    = 2,
  1929.     kPreviewMakePreviewReferenceSelector = 3,
  1930.     kPreviewEventSelector        = 4
  1931. };
  1932.  
  1933.  
  1934. enum {
  1935.     ShowFilePreviewComponentType = 'pnot',
  1936.     CreateFilePreviewComponentType = 'pmak'
  1937. };
  1938.  
  1939. extern pascal ComponentResult PreviewShowData(pnotComponent p, OSType dataType, Handle data, const Rect *inHere)
  1940.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  1941.  
  1942. extern pascal ComponentResult PreviewMakePreview(pnotComponent p, OSType *previewType, Handle *previewResult, const FSSpec *sourceFile, ICMProgressProcRecordPtr progress)
  1943.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0002, 0x7000, 0xA82A);
  1944.  
  1945. extern pascal ComponentResult PreviewMakePreviewReference(pnotComponent p, OSType *previewType, short *resID, const FSSpec *sourceFile)
  1946.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  1947.  
  1948. extern pascal ComponentResult PreviewEvent(pnotComponent p, EventRecord *e, Boolean *handledEvent)
  1949.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1950.  
  1951. typedef pascal void (*DataHCompletionProcPtr)(Ptr request, long refcon, OSErr err);
  1952.  
  1953. #if GENERATINGCFM
  1954. typedef UniversalProcPtr DataHCompletionUPP;
  1955. #else
  1956. typedef DataHCompletionProcPtr DataHCompletionUPP;
  1957. #endif
  1958.  
  1959. enum {
  1960.     kDataHCanRead                = 1L << 0,
  1961.     kDataHSpecialRead            = 1L << 1,
  1962.     kDataHSpecialReadFile        = 1L << 2,
  1963.     kDataHCanWrite                = 1L << 3,
  1964.     kDataHSpecialWrite            = 1 << 4,
  1965.     kDataHSpecialWriteFile        = 1 << 5,
  1966.     kDataHCanStreamingWrite        = 1 << 6,
  1967.     kDataHMustCheckDataRef        = 1 << 7
  1968. };
  1969.  
  1970. struct DataHVolumeListRecord {
  1971.     short                             vRefNum;
  1972.     long                             flags;
  1973. };
  1974. typedef struct DataHVolumeListRecord DataHVolumeListRecord;
  1975.  
  1976. typedef DataHVolumeListRecord *DataHVolumeListPtr;
  1977. typedef DataHVolumeListPtr *DataHVolumeList;
  1978.  
  1979. enum {
  1980.     kDataHExtendedSchedule        = 'xtnd'
  1981. };
  1982.  
  1983. struct DataHScheduleRecord {
  1984.     TimeRecord                         timeNeededBy;
  1985.     long                             extendedID;                    /* always is kDataHExtendedSchedule*/
  1986.     long                             extendedVers;                /* always set to 0*/
  1987.     Fixed                             priority;                    /* 100.0 or more means must have. lower numbers...*/
  1988. };
  1989. typedef struct DataHScheduleRecord DataHScheduleRecord;
  1990.  
  1991. typedef DataHScheduleRecord *DataHSchedulePtr;
  1992. extern pascal ComponentResult DataHGetData(DataHandler dh, Handle h, long hOffset, long offset, long size)
  1993.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0002, 0x7000, 0xA82A);
  1994.  
  1995. extern pascal ComponentResult DataHPutData(DataHandler dh, Handle h, long hOffset, long *offset, long size)
  1996.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0003, 0x7000, 0xA82A);
  1997.  
  1998. extern pascal ComponentResult DataHFlushData(DataHandler dh)
  1999.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  2000.  
  2001. extern pascal ComponentResult DataHOpenForWrite(DataHandler dh)
  2002.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);
  2003.  
  2004. extern pascal ComponentResult DataHCloseForWrite(DataHandler dh)
  2005.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0006, 0x7000, 0xA82A);
  2006.  
  2007. extern pascal ComponentResult DataHOpenForRead(DataHandler dh)
  2008.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0008, 0x7000, 0xA82A);
  2009.  
  2010. extern pascal ComponentResult DataHCloseForRead(DataHandler dh)
  2011.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);
  2012.  
  2013. extern pascal ComponentResult DataHSetDataRef(DataHandler dh, Handle dataRef)
  2014.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  2015.  
  2016. extern pascal ComponentResult DataHGetDataRef(DataHandler dh, Handle *dataRef)
  2017.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000B, 0x7000, 0xA82A);
  2018.  
  2019. extern pascal ComponentResult DataHCompareDataRef(DataHandler dh, Handle dataRef, Boolean *equal)
  2020.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000C, 0x7000, 0xA82A);
  2021.  
  2022. extern pascal ComponentResult DataHTask(DataHandler dh)
  2023.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x000D, 0x7000, 0xA82A);
  2024.  
  2025. extern pascal ComponentResult DataHScheduleData(DataHandler dh, Ptr PlaceToPutDataPtr, long FileOffset, long DataSize, long RefCon, DataHSchedulePtr scheduleRec, DataHCompletionUPP CompletionRtn)
  2026.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x000E, 0x7000, 0xA82A);
  2027.  
  2028. extern pascal ComponentResult DataHFinishData(DataHandler dh, Ptr PlaceToPutDataPtr, Boolean Cancel)
  2029.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x000F, 0x7000, 0xA82A);
  2030.  
  2031. extern pascal ComponentResult DataHFlushCache(DataHandler dh)
  2032.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0010, 0x7000, 0xA82A);
  2033.  
  2034. extern pascal ComponentResult DataHResolveDataRef(DataHandler dh, Handle theDataRef, Boolean *wasChanged, Boolean userInterfaceAllowed)
  2035.  FIVEWORDINLINE(0x2F3C, 0x000A, 0x0011, 0x7000, 0xA82A);
  2036.  
  2037. extern pascal ComponentResult DataHGetFileSize(DataHandler dh, long *fileSize)
  2038.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  2039.  
  2040. extern pascal ComponentResult DataHCanUseDataRef(DataHandler dh, Handle dataRef, long *useFlags)
  2041.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  2042.  
  2043. extern pascal ComponentResult DataHGetVolumeList(DataHandler dh, DataHVolumeList *volumeList)
  2044.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0014, 0x7000, 0xA82A);
  2045.  
  2046. extern pascal ComponentResult DataHWrite(DataHandler dh, Ptr data, long offset, long size, DataHCompletionUPP completion, long refCon)
  2047.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0015, 0x7000, 0xA82A);
  2048.  
  2049. extern pascal ComponentResult DataHPreextend(DataHandler dh, long maxToAdd, long *spaceAdded)
  2050.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0016, 0x7000, 0xA82A);
  2051.  
  2052. extern pascal ComponentResult DataHSetFileSize(DataHandler dh, long fileSize)
  2053.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0017, 0x7000, 0xA82A);
  2054.  
  2055. extern pascal ComponentResult DataHGetFreeSpace(DataHandler dh, unsigned long *freeSize)
  2056.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  2057.  
  2058. extern pascal ComponentResult DataHCreateFile(DataHandler dh, OSType creator, Boolean deleteExisting)
  2059.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0019, 0x7000, 0xA82A);
  2060.  
  2061. extern pascal ComponentResult DataHGetPreferredBlockSize(DataHandler dh, long *blockSize)
  2062.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  2063.  
  2064. extern pascal ComponentResult DataHGetDeviceIndex(DataHandler dh, long *deviceIndex)
  2065.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  2066.  
  2067. extern pascal ComponentResult DataHIsStreamingDataHandler(DataHandler dh, Boolean *yes)
  2068.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001C, 0x7000, 0xA82A);
  2069.  
  2070. extern pascal ComponentResult DataHGetDataInBuffer(DataHandler dh, long startOffset, long *size)
  2071.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001D, 0x7000, 0xA82A);
  2072.  
  2073. extern pascal ComponentResult DataHGetScheduleAheadTime(DataHandler dh, long *millisecs)
  2074.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001E, 0x7000, 0xA82A);
  2075.  
  2076. extern pascal ComponentResult DataHSetCacheSizeLimit(DataHandler dh, Size cacheSizeLimit)
  2077.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001F, 0x7000, 0xA82A);
  2078.  
  2079. extern pascal ComponentResult DataHGetCacheSizeLimit(DataHandler dh, Size *cacheSizeLimit)
  2080.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  2081.  
  2082. extern pascal ComponentResult DataHGetMovie(DataHandler dh, Movie *theMovie, short *id)
  2083.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  2084.  
  2085. extern pascal ComponentResult DataHAddMovie(DataHandler dh, Movie theMovie, short *id)
  2086.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  2087.  
  2088. extern pascal ComponentResult DataHUpdateMovie(DataHandler dh, Movie theMovie, short id)
  2089.  FIVEWORDINLINE(0x2F3C, 0x0006, 0x0023, 0x7000, 0xA82A);
  2090.  
  2091. extern pascal ComponentResult DataHDoesBuffer(DataHandler dh, Boolean *buffersReads, Boolean *buffersWrites)
  2092.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  2093.  
  2094. extern pascal ComponentResult DataHPlaybackHints(DataHandler dh, long flags, unsigned long minFileOffset, unsigned long maxFileOffset, long bytesPerSecond)
  2095.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0103, 0x7000, 0xA82A);
  2096.  
  2097.  
  2098. enum {
  2099.     kDataHGetDataSelect            = 0x02,
  2100.     kDataHPutDataSelect            = 0x03,
  2101.     kDataHFlushDataSelect        = 0x04,
  2102.     kDataHOpenForWriteSelect    = 0x05,
  2103.     kDataHCloseForWriteSelect    = 0x06,
  2104.     kDataHOpenForReadSelect        = 0x08,
  2105.     kDataHCloseForReadSelect    = 0x09,
  2106.     kDataHSetDataRefSelect        = 0x0A,
  2107.     kDataHGetDataRefSelect        = 0x0B,
  2108.     kDataHCompareDataRefSelect    = 0x0C,
  2109.     kDataHTaskSelect            = 0x0D,
  2110.     kDataHScheduleDataSelect    = 0x0E,
  2111.     kDataHFinishDataSelect        = 0x0F,
  2112.     kDataHFlushCacheSelect        = 0x10,
  2113.     kDataHResolveDataRefSelect    = 0x11,
  2114.     kDataHGetFileSizeSelect        = 0x12,
  2115.     kDataHCanUseDataRefSelect    = 0x13,
  2116.     kDataHGetVolumeListSelect    = 0x14,
  2117.     kDataHWriteSelect            = 0x15,
  2118.     kDataHPreextendSelect        = 0x16,
  2119.     kDataHSetFileSizeSelect        = 0x17,
  2120.     kDataHGetFreeSpaceSelect    = 0x18,
  2121.     kDataHCreateFileSelect        = 0x19,
  2122.     kDataHGetPreferredBlockSizeSelect = 0x1A,
  2123.     kDataHGetDeviceIndexSelect    = 0x1B,
  2124.     kDataHIsStreamingDataHandlerSelect = 0x1C,
  2125.     kDataHGetDataInBufferSelect    = 0x1D,
  2126.     kDataHGetScheduleAheadTimeSelect = 0x1E,
  2127.     kDataHSetCacheSizeLimitSelect = 0x1F,
  2128.     kDataHGetCacheSizeLimitSelect = 0x20,
  2129.     kDataHGetMovieSelect        = 0x21,
  2130.     kDataHAddMovieSelect        = 0x22,
  2131.     kDataHUpdateMovieSelect        = 0x23,
  2132.     kDataHDoesBufferSelect        = 0x24,
  2133.     kDataHPlaybackHintsSelect    = 0x0103
  2134. };
  2135.  
  2136.  
  2137. enum {
  2138.     kMusicComponentType            = 'musi'
  2139. };
  2140.  
  2141. typedef ComponentInstance MusicComponent;
  2142. /* MusicSynthesizerFlags*/
  2143.  
  2144. enum {
  2145.     kSynthesizerDynamicVoice    = 1,                            /* can reassign voices/channels (else, hogs all channels in mask */
  2146.     kSynthesizerUsesMIDIPort    = 2,                            /* must be patched through MIDI Manager */
  2147.     kSynthesizerMicrotone        = 4,                            /* can play microtonal scales */
  2148.     kSynthesizerLimitedMicrotone = 8,                            /* can play microtones, but only on 1-voice parts */
  2149.     kSynthesizerMixedDrums        = 16,                            /* any part can play drum parts, total = instrument parts */
  2150.     kSynthesizerSoftware        = 32,                            /* implemented in main CPU software == uses cpu cycles */
  2151.     kSynthesizerGMSuperset        = 8192,
  2152.     kSynthesizerGM                = 16384                            /* synth is a GM device */
  2153. };
  2154.  
  2155. /*
  2156.  * Note that these controller numbers
  2157.  * are _not_ identical to the MIDI controller numbers.
  2158.  * These are _signed_ 8.8 values, and the LSB's are
  2159.  * always sent to a MIDI device. Controllers 32-63 are
  2160.  * reserved (for MIDI, they are LSB's for 0-31, but we
  2161.  * always send both).
  2162.  *
  2163.  * The full range, therefore, is -128.00 to 127.7f.
  2164.  *
  2165.  * _Excepting_ _volume_, all controls default to zero.
  2166.  *
  2167.  * Pitch bend is specified in fractional semitones! No
  2168.  * more "pitch bend range" nonsense. You can bend as far
  2169.  * as you want, any time you want.
  2170. */
  2171.  
  2172. enum {
  2173.     kControllerModulationWheel    = 1,
  2174.     kControllerBreath            = 2,
  2175.     kControllerFoot                = 4,
  2176.     kControllerPortamentoTime    = 5,
  2177.     kControllerVolume            = 7,
  2178.     kControllerBalance            = 8,
  2179.     kControllerPan                = 10,                            /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  2180.     kControllerExpression        = 11,
  2181.     kControllerPitchBend        = 32,                            /* positive & negative semitones, with 7 bits fraction */
  2182.     kControllerAfterTouch        = 33,
  2183.     kControllerSustain            = 64,                            /* boolean - positive for on, 0 or negative off */
  2184.     kControllerPortamento        = 65,                            /* boolean */
  2185.     kControllerSostenuto        = 66,                            /* boolean */
  2186.     kControllerSoftPedal        = 67,                            /* boolean */
  2187.     kControllerReverb            = 91,
  2188.     kControllerTremolo            = 92,
  2189.     kControllerChorus            = 93,
  2190.     kControllerCeleste            = 94,
  2191.     kControllerPhaser            = 95
  2192. };
  2193.  
  2194.  
  2195. enum {
  2196.     kControllerMaximum            = 0x7FFF,                        /* +01111111.11111111 */
  2197.     kControllerMinimum            = 0x8000                        /* -10000000.00000000 */
  2198. };
  2199.  
  2200. struct SynthesizerDescription {
  2201.     OSType                             synthesizerType;            /* synthesizer type (must be same as component subtype) */
  2202.     Str31                             name;                        /* text name of synthesizer type */
  2203.     unsigned long                     flags;                        /* from the above enum */
  2204.     unsigned long                     voiceCount;                    /* maximum polyphony */
  2205.  
  2206.     unsigned long                     partCount;                    /* maximum multi-timbrality (and midi channels) */
  2207.     unsigned long                     instrumentCount;            /* non gm, built in (rom) instruments only */
  2208.     unsigned long                     modifiableInstrumentCount;    /* plus n-more are user modifiable */
  2209.     unsigned long                     channelMask;                /* (midi device only) which channels device always uses */
  2210.  
  2211.     unsigned long                     drumPartCount;                /* maximum multi-timbrality of drum parts */
  2212.     unsigned long                     drumCount;                    /* non gm, built in (rom) drumkits only */
  2213.     unsigned long                     modifiableDrumCount;        /* plus n-more are user modifiable */
  2214.     unsigned long                     drumChannelMask;            /* (midi device only) which channels device always uses */
  2215.  
  2216.     unsigned long                     outputCount;                /* number of audio outputs (usually two) */
  2217.     unsigned long                     latency;                    /* response time in µSec */
  2218.  
  2219.     unsigned long                     controllers[4];                /* array of 128 bits */
  2220.     unsigned long                     gmInstruments[4];            /* array of 128 bits */
  2221.     unsigned long                     gmDrums[4];                    /* array of 128 bits */
  2222. };
  2223. typedef struct SynthesizerDescription SynthesizerDescription;
  2224.  
  2225.  
  2226. enum {
  2227.     kVoiceCountDynamic            = -1                            /* constant to use to specify dynamic voicing */
  2228. };
  2229.  
  2230. struct ToneDescription {
  2231.     OSType                             synthesizerType;            /* synthesizer type */
  2232.     Str31                             synthesizerName;            /* name of instantiation of synth */
  2233.     Str31                             instrumentName;                /* preferred name for human use */
  2234.     long                             instrumentNumber;            /* inst-number used if synth-name matches */
  2235.     long                             gmNumber;                    /* Best matching general MIDI number */
  2236. };
  2237. typedef struct ToneDescription ToneDescription;
  2238.  
  2239.  
  2240. enum {
  2241.     kFirstDrumkit                = 16384,                        /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  2242.     kLastDrumkit                = (kFirstDrumkit + 128)
  2243. };
  2244.  
  2245. /* InstrumentMatch*/
  2246.  
  2247. enum {
  2248.     kInstrumentMatchSynthesizerType = 1,
  2249.     kInstrumentMatchSynthesizerName = 2,
  2250.     kInstrumentMatchName        = 4,
  2251.     kInstrumentMatchNumber        = 8,
  2252.     kInstrumentMatchGMNumber    = 16
  2253. };
  2254.  
  2255. /* KnobFlags*/
  2256.  
  2257. enum {
  2258.     kKnobRealtime                = 1,                            /* Knob can be changed interactively as part of a sequence (ie knob can be changed at interrupt time) */
  2259.     kKnobNextNote                = 2,                            /* Knob only takes effect on the next note played */
  2260.     kKnobAction                    = 4,                            /* setting the knob does something immediate */
  2261.     kKnobNotInstrument            = 8,                            /* indicates that the knob isn't in the instrument handle */
  2262.     kKnobAffectsOthers            = 16,                            /* other knobs will change value from this one */
  2263.     kKnobMinorGroupStart        = 64,                            /* knob is first in some logical subgroup of knobs */
  2264.     kKnobGroupStart                = 128,                            /* knob is first in some logical group of knobs */
  2265.                                                                 /* One of these may be used at a time. */
  2266.     kKnobTypeNumber                = 0 << 12,
  2267.     kKnobTypeBoolean            = 1 << 12,
  2268.     kKnobTypeNote                = 2 << 12,
  2269.     kKnobTypePan                = 3 << 12,
  2270.     kKnobTypeInstrument            = 4 << 12,                        /* knob value = reference to another instrument number */
  2271.     kKnobTypeSetting            = 5 << 12                        /* knob value is 1 of n different things (eg, fm algorithms) */
  2272. };
  2273.  
  2274.  
  2275. enum {
  2276.     kUnknownKnobValue            = 0x7FFFFFFF                    /* a knob with this value means, we don't know it. */
  2277. };
  2278.  
  2279. struct KnobDescription {
  2280.     Str31                             name;
  2281.     long                             lowValue;
  2282.     long                             highValue;
  2283.     long                             defaultValue;                /* a default instrument is made of all default values */
  2284.     long                             flags;
  2285. };
  2286. typedef struct KnobDescription KnobDescription;
  2287.  
  2288. struct InstrumentData {
  2289.     ToneDescription                 tone;
  2290.     long                             knobCount;
  2291.     long                             knob[1];
  2292. };
  2293. typedef struct InstrumentData InstrumentData;
  2294.  
  2295. typedef InstrumentData *InstrumentDataPtr;
  2296. typedef InstrumentDataPtr *InstrumentDataHandle;
  2297. struct FlatInstrument {
  2298.     ToneDescription                 tone;
  2299.     long                             size;                        /* size in bytes of the following data, including size field (excluding tonedescription) */
  2300.     UInt8                             data[4];
  2301. };
  2302. typedef struct FlatInstrument FlatInstrument;
  2303.  
  2304. struct InstrumentAboutInfo {
  2305.     PicHandle                         p;
  2306.     Str255                             author;
  2307.     Str255                             copyright;
  2308.     Str255                             other;
  2309. };
  2310. typedef struct InstrumentAboutInfo InstrumentAboutInfo;
  2311.  
  2312. struct MusicMIDIPacket {
  2313.     unsigned short                     length;
  2314.     unsigned long                     reserved;
  2315.     UInt8                             data[249];
  2316. };
  2317. typedef struct MusicMIDIPacket MusicMIDIPacket;
  2318.  
  2319. typedef pascal ComponentResult (*MusicMIDISendProcPtr)(MusicComponent self, long refCon, MusicMIDIPacket *mmp);
  2320.  
  2321. #if GENERATINGCFM
  2322. typedef UniversalProcPtr MusicMIDISendUPP;
  2323. #else
  2324. typedef MusicMIDISendProcPtr MusicMIDISendUPP;
  2325. #endif
  2326. /*--------------------------------*/
  2327.  
  2328. enum {
  2329.     kMusicFirstSelect            = 0,
  2330.     kMusicGetDescriptionSelect    = 1,
  2331.     kMusicGetPartSelect            = 2,
  2332.     kMusicSetPartSelect            = 3,
  2333.     kMusicSetInstrumentNumberSelect = 4,
  2334.     kMusicGetInstrumentNumberSelect = 5,
  2335.     kMusicStoreInstrumentSelect    = 6,
  2336.     kMusicGetInstrumentSelect    = 7,
  2337.     kMusicSetInstrumentSelect    = 8,
  2338.     kMusicDummyOne                = 9,
  2339.     kMusicDummyTwo                = 10,
  2340.     kMusicDummyThree            = 11,
  2341.     kMusicDummyFour                = 12,
  2342.     kMusicGetInstrumentKnobDescriptionSelect = 13,
  2343.     kMusicGetDrumKnobDescriptionSelect = 14,
  2344.     kMusicGetKnobDescriptionSelect = 15,
  2345.     kMusicGetPartKnobSelect        = 16,
  2346.     kMusicSetPartKnobSelect        = 17,
  2347.     kMusicGetKnobSelect            = 18,
  2348.     kMusicSetKnobSelect            = 19,
  2349.     kMusicGetPartNameSelect        = 20,
  2350.     kMusicSetPartNameSelect        = 21,
  2351.     kMusicFindToneSelect        = 22,
  2352.     kMusicPlayNoteSelect        = 23,
  2353.     kMusicResetPartSelect        = 24,
  2354.     kMusicSetControllerSelect    = 25,
  2355.     kMusicGetControllerSelect    = 26,
  2356.     kMusicGetMIDIProcSelect        = 27,
  2357.     kMusicSetMIDIProcSelect        = 28,
  2358.     kMusicGetInstrumentNamesSelect = 29,
  2359.     kMusicGetDrumNamesSelect    = 30,
  2360.     kMusicGetMasterTuneSelect    = 31,
  2361.     kMusicSetMasterTuneSelect    = 32,
  2362.     kMusicSetFlatInstrumentSelect = 33,
  2363.     kMusicGetInstrumentAboutInfoSelect = 34
  2364. };
  2365.  
  2366.  
  2367. enum {
  2368.     notImplementedMusicErr        = (0x8000F7CC - 1),
  2369.     cantSendToSynthesizerErr    = (0x8000F7CC - 2),
  2370.     cantReceiveFromSynthesizerErr = (0x8000F7CC - 3),
  2371.     illegalVoiceAllocationErr    = (0x8000F7CC - 4),
  2372.     illegalPartErr                = (0x8000F7CC - 5),
  2373.     illegalChannelErr            = (0x8000F7CC - 6),
  2374.     illegalKnobErr                = (0x8000F7CC - 7),
  2375.     illegalKnobValueErr            = (0x8000F7CC - 8),
  2376.     illegalInstrumentErr        = (0x8000F7CC - 9),
  2377.     illegalControllerErr        = (0x8000F7CC - 10),
  2378.     midiManagerAbsentErr        = (0x8000F7CC - 11),
  2379.     synthesizerNotRespondingErr    = (0x8000F7CC - 12),
  2380.     synthesizerErr                = (0x8000F7CC - 13),
  2381.     illegalNoteChannelErr        = (0x8000F7CC - 14),
  2382.     noteChannelNotAllocatedErr    = (0x8000F7CC - 15),
  2383.     tunePlayerFullErr            = (0x8000F7CC - 16),
  2384.     tuneParseErr                = (0x8000F7CC - 17)
  2385. };
  2386.  
  2387.  
  2388. enum {
  2389.     kGMType                        = 'gm  '                        /* subtype for General MIDI music component */
  2390. };
  2391.  
  2392. /*
  2393. -----------------------------------------
  2394.     Capabilities and Voice Allocation
  2395. -----------------------------------------
  2396. */
  2397. extern pascal ComponentResult MusicGetPart(MusicComponent mc, long part, long *midiChannel, long *polyphony)
  2398.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  2399.  
  2400. extern pascal ComponentResult MusicSetPart(MusicComponent mc, long part, long midiChannel, long polyphony)
  2401.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  2402.  
  2403. extern pascal ComponentResult MusicGetDescription(MusicComponent mc, SynthesizerDescription *sd)
  2404.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  2405.  
  2406. extern pascal ComponentResult MusicGetInstrumentAboutInfo(MusicComponent mc, long part, InstrumentAboutInfo *iai)
  2407.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  2408.  
  2409. /*
  2410. -----------------------------------------
  2411.     Instrument Loading and Storing
  2412. -----------------------------------------
  2413. */
  2414. extern pascal ComponentResult MusicSetInstrumentNumber(MusicComponent mc, long part, long instrumentNumber)
  2415.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  2416.  
  2417. extern pascal ComponentResult MusicGetInstrumentNumber(MusicComponent mc, long part)
  2418.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  2419.  
  2420. extern pascal ComponentResult MusicStoreInstrument(MusicComponent mc, long part, long instrumentNumber)
  2421.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  2422.  
  2423. extern pascal ComponentResult MusicGetInstrument(MusicComponent mc, long part, InstrumentDataHandle *iH)
  2424.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0007, 0x7000, 0xA82A);
  2425.  
  2426. extern pascal ComponentResult MusicSetInstrument(MusicComponent mc, long part, InstrumentDataHandle iH)
  2427.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  2428.  
  2429. extern pascal ComponentResult MusicSetFlatInstrument(MusicComponent mc, long part, FlatInstrument *flatInstrument)
  2430.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  2431.  
  2432. /*
  2433. -----------------------------------------
  2434.     Instrument Knobs
  2435. -----------------------------------------
  2436. */
  2437. extern pascal ComponentResult MusicGetInstrumentKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2438.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  2439.  
  2440. extern pascal ComponentResult MusicGetDrumKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2441.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  2442.  
  2443. extern pascal ComponentResult MusicGetPartKnob(MusicComponent mc, long part, long knobNumber)
  2444.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  2445.  
  2446. extern pascal ComponentResult MusicSetPartKnob(MusicComponent mc, long part, long knobNumber, long knobValue)
  2447.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  2448.  
  2449. /*
  2450. -----------------------------------------
  2451.     Synthesizer Knobs
  2452. -----------------------------------------
  2453. */
  2454. extern pascal ComponentResult MusicGetKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2455.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  2456.  
  2457. extern pascal ComponentResult MusicGetKnob(MusicComponent mc, long knobNumber)
  2458.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  2459.  
  2460. extern pascal ComponentResult MusicSetKnob(MusicComponent mc, long knobNumber, long knobValue)
  2461.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  2462.  
  2463. extern pascal ComponentResult MusicSetMasterTune(MusicComponent mc, Fixed masterTune)
  2464.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  2465.  
  2466. extern pascal ComponentResult MusicGetMasterTune(MusicComponent mc)
  2467.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  2468.  
  2469. /*
  2470. -----------------------------------------
  2471.     Names of Instruments
  2472. -----------------------------------------
  2473. */
  2474. extern pascal ComponentResult MusicGetPartName(MusicComponent mc, long part, Str31 name)
  2475.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  2476.  
  2477. extern pascal ComponentResult MusicSetPartName(MusicComponent mc, long part, Str31 name)
  2478.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  2479.  
  2480. extern pascal ComponentResult MusicFindTone(MusicComponent mc, ToneDescription *td, long *instrumentNumber, unsigned long *fit)
  2481.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  2482.  
  2483. extern pascal ComponentResult MusicGetInstrumentNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNames, Handle *instrumentCategoryLasts, Handle *instrumentCategoryNames)
  2484.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  2485.  
  2486. extern pascal ComponentResult MusicGetDrumNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNumbers, Handle *instrumentNames)
  2487.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  2488.  
  2489. /*
  2490. -----------------------------------------
  2491.     Realtime Actions
  2492. -----------------------------------------
  2493. */
  2494. extern pascal ComponentResult MusicPlayNote(MusicComponent mc, long part, long pitch, long velocity)
  2495.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  2496.  
  2497. extern pascal ComponentResult MusicResetPart(MusicComponent mc, long part)
  2498.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  2499.  
  2500. extern pascal ComponentResult MusicSetController(MusicComponent mc, long part, long controllerNumber, long controllerValue)
  2501.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  2502.  
  2503. extern pascal ComponentResult MusicGetController(MusicComponent mc, long part, long controllerNumber)
  2504.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  2505.  
  2506. /*
  2507. -----------------------------------------
  2508.     Finding the Hardware
  2509. -----------------------------------------
  2510. */
  2511. extern pascal ComponentResult MusicGetMIDIProc(MusicComponent mc, MusicMIDISendUPP *midiSendProc, long *refCon)
  2512.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  2513.  
  2514. extern pascal ComponentResult MusicSetMIDIProc(MusicComponent mc, MusicMIDISendUPP midiSendProc, long refCon)
  2515.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  2516.  
  2517. /*
  2518. --------------------------
  2519.     Types
  2520. --------------------------
  2521. */
  2522. struct NoteChannelRecord {
  2523.     long                             data[1];
  2524. };
  2525. typedef struct NoteChannelRecord NoteChannelRecord;
  2526.  
  2527. typedef NoteChannelRecord *NoteChannel;
  2528. /* used for MIDI device only */
  2529. struct SynthesizerConnections {
  2530.     OSType                             clientID;
  2531.     OSType                             inputPortID;
  2532.     OSType                             outputPortID;
  2533.     long                             midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  2534.     long                             flags;
  2535.     long                             reserved[3];                /* should be zero */
  2536. };
  2537. typedef struct SynthesizerConnections SynthesizerConnections;
  2538.  
  2539. struct NoteRequest {
  2540.     long                             polyphony;                    /* Maximum number of voices */
  2541.     Fixed                             typicalPolyphony;            /* Hint for level mixing */
  2542.     ToneDescription                 tone;
  2543. };
  2544. typedef struct NoteRequest NoteRequest;
  2545.  
  2546.  
  2547. enum {
  2548.     kNAFirstSelector            = -7,
  2549.     kNATargetSelect                = -6,
  2550.     kNARegisterSelect            = -5,
  2551.     kNAVersionSelect            = -4,
  2552.     kNACanDoSelect                = -3,
  2553.     kNACloseSelect                = -2,
  2554.     kNAOpenSelect                = -1,
  2555.     kNARegisterMusicDeviceSelect = 0,
  2556.     kNAUnregisterMusicDeviceSelect = 1,
  2557.     kNAGetRegisteredMusicDeviceSelect = 2,
  2558.     kNASaveMusicConfigurationSelect = 3,
  2559.     kNANewNoteChannelSelect        = 4,
  2560.     kNADisposeNoteChannelSelect    = 5,
  2561.     kNAGetNoteChannelInfoSelect    = 6,
  2562.     kNAPrerollNoteChannelSelect    = 7,
  2563.     kNAUnrollNoteChannelSelect    = 8,
  2564.     kNAEngageNoteChannelSelect    = 9,
  2565.     kNADisengageNoteChannelSelect = 10,
  2566.     kNASetNoteChannelVolumeSelect = 11,
  2567.     kNAResetNoteChannelSelect    = 12,
  2568.     kNAPlayNoteSelect            = 13,
  2569.     kNASetControllerSelect        = 14,
  2570.     kNASetKnobSelect            = 15,
  2571.     kNAFindNoteChannelToneSelect = 16,
  2572.     kNASetNoteChannelInstrumentSelect = 17,
  2573.     kNAPickInstrumentSelect        = 18,
  2574.     kNAPickArrangementSelect    = 19,
  2575.     kNAGetStatusBlockSelect        = 20,
  2576.     kNASetDefaultMIDIInputSelect = 21,
  2577.     kNAGetDefaultMIDIInputSelect = 22,
  2578.     kNAGetNoteChannelStateSelect = 23,
  2579.     kNASetNoteChannelStateSelect = 24,
  2580.     kNAUseDefaultMIDIInputSelect = 25,
  2581.     kNALoseDefaultMIDIInputSelect = 26,
  2582.     kNAStuffToneDescriptionSelect = 27,
  2583.     kNACopyrightDialogSelect    = 28,
  2584.     kNASetFlatInstrumentSelect    = 29,
  2585.     kNASetInstrumentSelect        = 30,
  2586.     kNALastSelector                = 31
  2587. };
  2588.  
  2589. typedef ComponentInstance NoteAllocator;
  2590.  
  2591. enum {
  2592.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  2593.     kPickSameSynth                = 2                                /* only allow the same device that went in, to come out */
  2594. };
  2595.  
  2596. typedef pascal ComponentResult (*MusicMIDIReadHookProcPtr)(MusicMIDIPacket *mp, long myRefCon);
  2597.  
  2598. #if GENERATINGCFM
  2599. typedef UniversalProcPtr MusicMIDIReadHookUPP;
  2600. #else
  2601. typedef MusicMIDIReadHookProcPtr MusicMIDIReadHookUPP;
  2602. #endif
  2603.  
  2604. enum {
  2605.     kNoteAllocatorType            = 'nota'
  2606. };
  2607.  
  2608. /*
  2609. --------------------------------
  2610.     Note Allocator Prototypes
  2611. --------------------------------
  2612. */
  2613. /*
  2614.  * System Configuration
  2615. */
  2616. extern pascal ComponentResult NARegisterMusicDevice(NoteAllocator na, OSType synthType, Str31 name, SynthesizerConnections *connections)
  2617.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  2618.  
  2619. extern pascal ComponentResult NAUnregisterMusicDevice(NoteAllocator na, long index)
  2620.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  2621.  
  2622. extern pascal ComponentResult NAGetRegisteredMusicDevice(NoteAllocator na, long index, OSType *synthType, Str31 name, SynthesizerConnections *connections, MusicComponent *mc)
  2623.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  2624.  
  2625. extern pascal ComponentResult NASetDefaultMIDIInput(NoteAllocator na, SynthesizerConnections *sc)
  2626.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  2627.  
  2628. extern pascal ComponentResult NAGetDefaultMIDIInput(NoteAllocator na, SynthesizerConnections *sc)
  2629.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  2630.  
  2631. extern pascal ComponentResult NASaveMusicConfiguration(NoteAllocator na)
  2632.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  2633.  
  2634. /*
  2635.  * Allocation
  2636. */
  2637. extern pascal ComponentResult NANewNoteChannel(NoteAllocator na, NoteRequest *noteRequest, NoteChannel *outChannel)
  2638.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  2639.  
  2640. extern pascal ComponentResult NADisposeNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2641.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  2642.  
  2643. extern pascal ComponentResult NAGetNoteChannelInfo(NoteAllocator na, NoteChannel noteChannel, long *index, long *part)
  2644.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  2645.  
  2646. extern pascal ComponentResult NAUseDefaultMIDIInput(NoteAllocator na, MusicMIDIReadHookUPP readHook, long refCon, unsigned long flags)
  2647.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  2648.  
  2649. extern pascal ComponentResult NALoseDefaultMIDIInput(NoteAllocator na)
  2650.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  2651.  
  2652. /*
  2653.  * Setup
  2654. */
  2655. extern pascal ComponentResult NAPrerollNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2656.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  2657.  
  2658. extern pascal ComponentResult NAUnrollNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2659.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  2660.  
  2661. extern pascal ComponentResult NAEngageNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2662.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);
  2663.  
  2664. extern pascal ComponentResult NADisengageNoteChannel(NoteAllocator na, NoteChannel noteChannel, long silenceNotes)
  2665.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000A, 0x7000, 0xA82A);
  2666.  
  2667. extern pascal ComponentResult NAGetNoteChannelState(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber, Handle *state)
  2668.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  2669.  
  2670. extern pascal ComponentResult NASetNoteChannelState(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber, Handle state)
  2671.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0018, 0x7000, 0xA82A);
  2672.  
  2673. extern pascal ComponentResult NAResetNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2674.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  2675.  
  2676. extern pascal ComponentResult NASetNoteChannelVolume(NoteAllocator na, NoteChannel noteChannel, Fixed volume)
  2677.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  2678.  
  2679. extern pascal ComponentResult NASetInstrument(NoteAllocator na, NoteChannel noteChannel, InstrumentData *instrumentData)
  2680.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001E, 0x7000, 0xA82A);
  2681.  
  2682. extern pascal ComponentResult NASetFlatInstrument(NoteAllocator na, NoteChannel noteChannel, FlatInstrument *flatInstrument)
  2683.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001D, 0x7000, 0xA82A);
  2684.  
  2685. /*
  2686.  * Control
  2687. */
  2688. extern pascal ComponentResult NAPlayNote(NoteAllocator na, NoteChannel noteChannel, long pitch, long velocity)
  2689.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  2690.  
  2691. extern pascal ComponentResult NASetController(NoteAllocator na, NoteChannel noteChannel, long controllerNumber, long controllerValue)
  2692.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  2693.  
  2694. extern pascal ComponentResult NASetKnob(NoteAllocator na, NoteChannel noteChannel, long knobNumber, long knobValue)
  2695.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  2696.  
  2697. extern pascal ComponentResult NAFindNoteChannelTone(NoteAllocator na, NoteChannel noteChannel, ToneDescription *td, long *instrumentNumber)
  2698.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  2699.  
  2700. extern pascal ComponentResult NASetNoteChannelInstrument(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber)
  2701.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  2702.  
  2703. #endif
  2704. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  2705. /*
  2706.  * User Interface
  2707. */
  2708. extern pascal ComponentResult NAPickInstrument(NoteAllocator na, ModalFilterUPP filterProc, StringPtr prompt, ToneDescription *sd, unsigned long flags, long refCon, Ptr *flatList, long *flatChoiceIndex)
  2709.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  2710.  
  2711. extern pascal ComponentResult NAStuffToneDescription(NoteAllocator na, long gmNumber, ToneDescription *td)
  2712.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  2713.  
  2714. extern pascal ComponentResult NAPickArrangement(NoteAllocator na, ModalFilterUPP filterProc, StringPtr prompt, long partCount, NoteRequest *noteRequestList, Track t, StringPtr songName)
  2715.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  2716.  
  2717. extern pascal ComponentResult NACopyrightDialog(NoteAllocator na, PicHandle p, StringPtr author, StringPtr copyright, StringPtr other, StringPtr title, ModalFilterUPP filterProc, long refCon)
  2718.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  2719.  
  2720. #endif
  2721. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  2722. /*
  2723.  * Note Allocator interior views
  2724. */
  2725. struct NAStatPiece {
  2726.     Str31                             clientName;
  2727.     Str31                             synthesizerName;
  2728.     long                             part;
  2729.     long                             midiChannel;
  2730.     long                             polyphony;
  2731.     long                             valid;
  2732. };
  2733. typedef struct NAStatPiece NAStatPiece;
  2734.  
  2735. struct NAStat {
  2736.     long                             pieceCount;
  2737.     NAStatPiece                     piece[64];
  2738. };
  2739. typedef struct NAStat NAStat;
  2740.  
  2741. extern pascal ComponentResult NAGetStatusBlock(NoteAllocator na, NAStat *stat)
  2742.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0014, 0x7000, 0xA82A);
  2743.  
  2744. /*
  2745. --------------------------
  2746.     Types
  2747. --------------------------
  2748. */
  2749.  
  2750. enum {
  2751.     kTuneQueueDepth                = 8                                /* Deepest you can queue tune segments */
  2752. };
  2753.  
  2754. struct TuneStatus {
  2755.     unsigned long *                    tune;                        /* currently playing tune */
  2756.     unsigned long *                    tunePtr;                    /* position within currently playing piece */
  2757.     TimeValue                         time;                        /* current tune time */
  2758.     short                             queueCount;                    /* how many pieces queued up? */
  2759.     short                             queueSpots;                    /* How many more tunepieces can be queued */
  2760.     TimeValue                         queueTime;                    /* How much time is queued up? (can be very inaccurate) */
  2761.     long                             reserved[3];
  2762. };
  2763. typedef struct TuneStatus TuneStatus;
  2764.  
  2765.  
  2766. enum {
  2767.     kStopTuneFade                = 1,                            /* do a quick, synchronous fadeout */
  2768.     kStopTuneSustain            = 2,                            /* don't silece notes */
  2769.     kStopTuneInstant            = 4,                            /* silence notes fast (else, decay them) */
  2770.     kStopTuneReleaseChannels    = 8                                /* afterwards, let the channels go */
  2771. };
  2772.  
  2773.  
  2774. enum {
  2775.     kTuneSelect                    = 3,
  2776.     kTuneSetHeaderSelect        = 4,
  2777.     kTuneGetTimeBaseSelect        = 5,
  2778.     kTuneSetTimeScaleSelect        = 6,
  2779.     kTuneGetTimeScaleSelect        = 7,
  2780.     kTuneGetIndexedNoteChannelSelect = 8,
  2781.     kTuneDummy                    = 9,
  2782.     kTuneQueueSelect            = 10,
  2783.     kTuneInstantSelect            = 11,
  2784.     kTuneGetStatusSelect        = 12,
  2785.     kTuneStopSelect                = 13,
  2786.     kTuneResumeSelect            = 14,
  2787.     kTuneFlushSelect            = 15,
  2788.     kTuneSetVolumeSelect        = 16,
  2789.     kTuneGetVolumeSelect        = 17,
  2790.     kTunePrerollSelect            = 18,
  2791.     kTuneUnrollSelect            = 19,
  2792.     kTuneLastSelector            = 20
  2793. };
  2794.  
  2795. typedef pascal void (*TuneCallBackProcPtr)(const TuneStatus *status, long refCon);
  2796. typedef pascal void (*TunePlayCallBackProcPtr)(unsigned long *event, long seed, long refCon);
  2797.  
  2798. #if GENERATINGCFM
  2799. typedef UniversalProcPtr TuneCallBackUPP;
  2800. typedef UniversalProcPtr TunePlayCallBackUPP;
  2801. #else
  2802. typedef TuneCallBackProcPtr TuneCallBackUPP;
  2803. typedef TunePlayCallBackProcPtr TunePlayCallBackUPP;
  2804. #endif
  2805. typedef ComponentInstance TunePlayer;
  2806.  
  2807. enum {
  2808.     kMaxTunePlayerParts            = 32,
  2809.     kTunePlayerType                = 'tune'
  2810. };
  2811.  
  2812. /*
  2813. --------------------------
  2814.     Prototypes
  2815. --------------------------
  2816. */
  2817. extern pascal ComponentResult TuneSetHeader(TunePlayer tp, unsigned long *header)
  2818.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  2819.  
  2820. extern pascal ComponentResult TuneGetTimeBase(TunePlayer tp, TimeBase *tb)
  2821.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  2822.  
  2823. extern pascal ComponentResult TuneSetTimeScale(TunePlayer tp, TimeScale scale)
  2824.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  2825.  
  2826. extern pascal ComponentResult TuneGetTimeScale(TunePlayer tp, TimeScale *scale)
  2827.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  2828.  
  2829. extern pascal ComponentResult TuneGetIndexedNoteChannel(TunePlayer tp, long i, NoteChannel *nc)
  2830.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  2831.  
  2832. /* Values for when to start. */
  2833.  
  2834. enum {
  2835.     kTuneStartNow                = 1,                            /* start after buffer is implied */
  2836.     kTuneDontClipNotes            = 2,                            /* allow notes to finish their durations outside sample */
  2837.     kTuneExcludeEdgeNotes        = 4,                            /* dont play notes that start at end of tune */
  2838.     kTuneStartNewMaster            = 16384
  2839. };
  2840.  
  2841. extern pascal ComponentResult TuneQueue(TunePlayer tp, unsigned long *tune, Fixed tuneRate, unsigned long tuneStartPosition, unsigned long tuneStopPosition, unsigned long queueFlags, TuneCallBackUPP callBackProc, long refCon)
  2842.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  2843.  
  2844. extern pascal ComponentResult TuneInstant(TunePlayer tp, unsigned long *tune, long tunePosition)
  2845.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  2846.  
  2847. extern pascal ComponentResult TuneGetStatus(TunePlayer tp, TuneStatus *status)
  2848.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  2849.  
  2850. /* Values for when to start. */
  2851.  
  2852. enum {
  2853.     kStopSustain                = 1,                            /* Leaves notes playing, not silent */
  2854.     kStopFadeout                = 2                                /* Does a synchronous fade-out */
  2855. };
  2856.  
  2857. extern pascal ComponentResult TuneStop(TunePlayer tp, long stopFlags)
  2858.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  2859.  
  2860. extern pascal ComponentResult TuneResume(TunePlayer tp)
  2861.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x000E, 0x7000, 0xA82A);
  2862.  
  2863. extern pascal ComponentResult TuneFlush(TunePlayer tp)
  2864.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x000F, 0x7000, 0xA82A);
  2865.  
  2866. extern pascal ComponentResult TuneSetVolume(TunePlayer tp, Fixed volume)
  2867.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  2868.  
  2869. extern pascal ComponentResult TuneGetVolume(TunePlayer tp)
  2870.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  2871.  
  2872. extern pascal ComponentResult TunePreroll(TunePlayer tp)
  2873.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  2874.  
  2875. extern pascal ComponentResult TuneUnroll(TunePlayer tp)
  2876.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  2877.  
  2878. typedef unsigned long MusicOpWord;
  2879. typedef unsigned long *MusicOpWordPtr;
  2880. /*
  2881.      QuickTime Music Track Event Formats:
  2882.  
  2883.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  2884.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  2885.     long CONTROL events, and variable GENERAL events.
  2886.  
  2887.         * REST Event (4 bytes/event):
  2888.     
  2889.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  2890.         
  2891.         *†Short NOTE Events (4 bytes/event):
  2892.     
  2893.             (0 0 1) (5-bit Instrument) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  2894.         
  2895.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  2896.  
  2897.         *†Short CONTROL Events (4 bytes/event):
  2898.     
  2899.             (0 1 0) (5-bit Instrument) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  2900.                                                                          ( or 15-bit Signed Value)
  2901.         * Short GENERAL Event (4 bytes/event):
  2902.     
  2903.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  2904.     
  2905.         * Long NOTE Events (8 bytes/event):
  2906.     
  2907.             (1 0 0 1) (12-bit Instrument) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  2908.             (1 0) (8-bit UNUSED) (22-bit Duration)
  2909.         
  2910.         *†Long CONTROL Event (8 bytes/event):
  2911.         
  2912.             (1 0 1 0) (12-bit Instrument) (16-bit Value MSB) 
  2913.             (1 0) (14-bit Controller) (16-bit Value LSB)
  2914.     
  2915.         *†Long KNOB Event (8 bytes/event):
  2916.     
  2917.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  2918.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  2919.     
  2920.         *†Variable GENERAL Length Events (N bytes/event):
  2921.     
  2922.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  2923.                 :
  2924.             (32-bit Data values)
  2925.                 :
  2926.             (1 1) (14-bit UNUSED) (16-bit Length)
  2927.     
  2928.             where:    Length field is the number of LONG words in the record.
  2929.                     Lengths include the first and last long words (Minimum length = 2)
  2930.                 
  2931.     The following event type values have not been used yet and are reserved for 
  2932.     future expansion:
  2933.         
  2934.         * (1 0 0 0)        (8 bytes/event)
  2935.         * (1 1 0 0)        (N bytes/event)
  2936.         * (1 1 0 1)        (N bytes/event)
  2937.         * (1 1 1 0)        (N bytes/event)
  2938.         
  2939.     For all events, the following generalizations apply:
  2940.     
  2941.         -    All duration values are specified in Millisecond units.
  2942.         -     Pitch values are intended to map directly to the MIDI key numbers.
  2943.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  2944.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  2945.             Key Pressure, and Channel Pressure).    
  2946. */
  2947. /* Defines for the implemented music event data fields*/
  2948.  
  2949. enum {
  2950.     kRestEventType                = 0x00000000,                    /* lower 3-bits */
  2951.     kNoteEventType                = 0x00000001,                    /* lower 3-bits */
  2952.     kControlEventType            = 0x00000002,                    /* lower 3-bits */
  2953.     kMarkerEventType            = 0x00000003,                    /* lower 3-bits */
  2954.     kUndefined1EventType        = 0x00000008,                    /* 4-bits */
  2955.     kXNoteEventType                = 0x00000009,                    /* 4-bits */
  2956.     kXControlEventType            = 0x0000000A,                    /* 4-bits */
  2957.     kKnobEventType                = 0x0000000B,                    /* 4-bits */
  2958.     kUndefined2EventType        = 0x0000000C,                    /* 4-bits */
  2959.     kUndefined3EventType        = 0x0000000D,                    /* 4-bits */
  2960.     kUndefined4EventType        = 0x0000000E,                    /* 4-bits */
  2961.     kGeneralEventType            = 0x0000000F,                    /* 4-bits */
  2962.     kXEventLengthBits            = 0x00000002,                    /* 2 bits: indicates 8-byte event record */
  2963.     kGeneralEventLengthBits        = 0x00000003,                    /* 2 bits: indicates variable length event record */
  2964.     kEventLen                    = 1L,                            /* length of events in long words */
  2965.     kXEventLen                    = 2L,
  2966.     kRestEventLen                = kEventLen,                    /* length of events in long words */
  2967.     kNoteEventLen                = kEventLen,
  2968.     kControlEventLen            = kEventLen,
  2969.     kMarkerEventLen                = kEventLen,
  2970.     kXNoteEventLen                = kXEventLen,
  2971.     kXControlEventLen            = kXEventLen,
  2972.     kGeneralEventLen            = kXEventLen,                    /* 2 or more, however */
  2973.                                                                 /* Universal Event Defines*/
  2974.     kEventLengthFieldPos        = 30,                            /* by looking at these two bits of the 1st or last word              */
  2975.     kEventLengthFieldWidth        = 2,                            /* of an event you can determine the event length                      */
  2976.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  2977.     kEventTypeFieldPos            = 29,                            /* event type field for short events */
  2978.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  2979.     kXEventTypeFieldPos            = 28,                            /* event type field for extended events */
  2980.     kXEventTypeFieldWidth        = 4,                            /* extended type is 4 bits */
  2981.     kEventInstrumentFieldPos    = 24,
  2982.     kEventInstrumentFieldWidth    = 5,
  2983.     kXEventInstrumentFieldPos    = 16,                            /* in the 1st long word */
  2984.     kXEventInstrumentFieldWidth    = 12,                            /* Rest Events*/
  2985.     kRestEventDurationFieldPos    = 0,
  2986.     kRestEventDurationFieldWidth = 24,
  2987.     kRestEventDurationMax        = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  2988.     kNoteEventPitchFieldPos        = 18,
  2989.     kNoteEventPitchFieldWidth    = 6,
  2990.     kNoteEventPitchOffset        = 32,                            /* add to value in pitch field to get actual pitch */
  2991.     kNoteEventVolumeFieldPos    = 11,
  2992.     kNoteEventVolumeFieldWidth    = 7,
  2993.     kNoteEventVolumeOffset        = 0,                            /* add to value in volume field to get actual volume */
  2994.     kNoteEventDurationFieldPos    = 0,
  2995.     kNoteEventDurationFieldWidth = 11,
  2996.     kNoteEventDurationMax        = ((1L << kNoteEventDurationFieldWidth) - 1),
  2997.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  2998.     kXNoteEventPitchFieldWidth    = 16,
  2999.     kXNoteEventDurationFieldPos    = 0,                            /* in the 2nd long word */
  3000.     kXNoteEventDurationFieldWidth = 22,
  3001.     kXNoteEventDurationMax        = ((1L << kXNoteEventDurationFieldWidth) - 1),
  3002.     kXNoteEventVolumeFieldPos    = 22,                            /* in the 2nd long word */
  3003.     kXNoteEventVolumeFieldWidth    = 7,                            /* Control Events*/
  3004.     kControlEventControllerFieldPos = 16,
  3005.     kControlEventControllerFieldWidth = 8,
  3006.     kControlEventValueFieldPos    = 0,
  3007.     kControlEventValueFieldWidth = 16,
  3008.     kXControlEventControllerFieldPos = 0,                        /* in the 2nd long word */
  3009.     kXControlEventControllerFieldWidth = 16,
  3010.     kXControlEventValueFieldPos    = 0,                            /* in the 1st long word */
  3011.     kXControlEventValueFieldWidth = 16,                            /* Knob Events*/
  3012.     kKnobEventValueHighFieldPos    = 0,                            /* 1st long word */
  3013.     kKnobEventValueHighFieldWidth = 16,
  3014.     kKnobEventKnobFieldPos        = 16,                            /* 2nd long word */
  3015.     kKnobEventKnobFieldWidth    = 14,
  3016.     kKnobEventValueLowFieldPos    = 0,                            /* 2nd long word */
  3017.     kKnobEventValueLowFieldWidth = 16,                            /* Marker Events*/
  3018.     kMarkerEventSubtypeFieldPos    = 16,
  3019.     kMarkerEventSubtypeFieldWidth = 8,
  3020.     kMarkerEventValueFieldPos    = 0,
  3021.     kMarkerEventValueFieldWidth    = 16,                            /* General Events*/
  3022.     kGeneralEventSubtypeFieldPos = 16,                            /* in the last long word */
  3023.     kGeneralEventSubtypeFieldWidth = 14,
  3024.     kGeneralEventLengthFieldPos    = 0,                            /* in the 1st & last long words */
  3025.     kGeneralEventLengthFieldWidth = 16
  3026. };
  3027.  
  3028. /* macros for extracting various fields from the QuickTime event records */
  3029. #define MASK(bitWidth)                 ((1L << (bitWidth)) - 1)
  3030. #define EXT(val, pos, width)         (((val) >> (pos)) & MASK(width))
  3031.  
  3032. #define _EventLength(x)             ((EXT(x, kEventLengthFieldPos,     \
  3033.                                             kEventLengthFieldWidth) < 2) ? 1 :     \
  3034.                                             ((EXT(x, kEventLengthFieldPos, kEventLengthFieldWidth) == 2) ? 2 : \
  3035.                                             EXT(x, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth)))
  3036.  
  3037. #define _EventType(x)                 ((EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  3038.  
  3039. #define _RestDuration(x)              (EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  3040.  
  3041. #define _Instrument(x)                 (EXT(x, kEventInstrumentFieldPos, kEventInstrumentFieldWidth))
  3042. #define _XInstrument(m, l)             (EXT(m, kXEventInstrumentFieldPos, kXEventInstrumentFieldWidth))
  3043.  
  3044. #define _NotePitch(x)                 (EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  3045. #define _NoteVolume(x)                 (EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  3046. #define _NoteDuration(x)             (EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  3047. #define _NoteVelocity _NoteVolume
  3048.  
  3049. #define _XNotePitch(m, l)             (EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  3050. #define _XNoteVolume(m, l)             (EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  3051. #define _XNoteDuration(m, l)         (EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  3052. #define _XNoteVelocity _XNoteVolume
  3053.  
  3054. #define _ControlController(x)         (EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  3055. #define _ControlValue(x)             (EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  3056.  
  3057. #define _XControlController(m, l)     (EXT(m, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  3058. #define _XControlValue(m, l)         (EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  3059.  
  3060. #define _MarkerSubtype(x)        (EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  3061. #define _MarkerValue(x)         (EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  3062.  
  3063. #define _KnobValue(m,l)                ((EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)    \
  3064.                                     | (EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  3065. #define _KnobKnob(m,l)                (EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  3066.  
  3067. #define _GeneralSubtype(m,l)        (EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  3068. #define _GeneralLength(m,l)           (EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  3069.  
  3070. #define _StuffRestEvent(x, duration)                                                                \
  3071.                         x =     (kRestEventType << kEventTypeFieldPos)                                \
  3072.                             |    ((long)(duration) << kRestEventDurationFieldPos)
  3073.  
  3074. #define _StuffNoteEvent(x, instrument, pitch, volume, duration)                                            \
  3075.                         x =     (kNoteEventType << kEventTypeFieldPos)                                    \
  3076.                             |     ((long)(instrument) << kEventInstrumentFieldPos)                        \
  3077.                             |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    \
  3078.                             |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)    \
  3079.                             |    ((long)(duration) << kNoteEventDurationFieldPos)
  3080.  
  3081. #define _StuffControlEvent(x, instrument, control, value)                                            \
  3082.                         x =     (kControlEventType << kEventTypeFieldPos)                            \
  3083.                             |     ((long)(instrument) << kEventInstrumentFieldPos)                    \
  3084.                             |    ((long)(control) << kControlEventControllerFieldPos)                \
  3085.                             |    ((long)((value) & MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos)
  3086.  
  3087. #define _StuffXNoteEvent(w1, w2, instrument, pitch, volume, duration)                                \
  3088.                         w1 =     (kXNoteEventType << kXEventTypeFieldPos)                            \
  3089.                             |    ((long)(instrument) << kXEventInstrumentFieldPos)                    \
  3090.                             |    ((long)(pitch) << kXNoteEventPitchFieldPos),                        \
  3091.                         w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            \
  3092.                             |    ((long)(duration) << kXNoteEventDurationFieldPos)                    \
  3093.                             |    ((long)(volume) << kXNoteEventVolumeFieldPos)                        \
  3094.  
  3095. #define _StuffXControlEvent(w1, w2, instrument, control, value)                                        \
  3096.                         w1 =     (kXControlEventType << kXEventTypeFieldPos)                            \
  3097.                             |    ((long)(instrument) << kXEventInstrumentFieldPos)                    \
  3098.                             |    ((long)((value) & MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), \
  3099.                         w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            \
  3100.                             |    ((long)(control) << kXControlEventControllerFieldPos)
  3101.  
  3102. #define _StuffKnobEvent(w1, w2, instrument, knob, value)                                        \
  3103.                         w1 =    (kKnobEventType << kXEventTypeFieldPos)                            \
  3104.                             |    ((long)(instrument) << kXEventInstrumentFieldPos)                \
  3105.                             |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),            \
  3106.                         w2 =    (kXEventLengthBits << kEventLengthFieldPos)                        \
  3107.                             |    ((long)(knob) << kKnobEventKnobFieldPos)                        \
  3108.                             |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos)
  3109.  
  3110. #define _StuffGeneralEvent(w1,w2,instrument,subType,length)                                        \
  3111.                         w1 =    (kGeneralEventType << kXEventTypeFieldPos)                        \
  3112.                             |    ((long)(instrument) << kXEventInstrumentFieldPos)                \
  3113.                             |    ((long)(length) << kGeneralEventLengthFieldPos),                \
  3114.                         w2 =    (kGeneralEventLengthBits << kEventLengthFieldPos)                \
  3115.                             |    ((long)(subType) << kGeneralEventSubtypeFieldPos)                \
  3116.                             |    ((long)(length) << kGeneralEventLengthFieldPos)
  3117.  
  3118. /* General Event Defined Types*/
  3119.  
  3120. enum {
  3121.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  3122.     kGeneralEventInstrument        = 2,                            /* Encapsulates poly, typical poly, followed by InstrumentData record */
  3123.     kGeneralEventFlatInstrument    = 3,                            /* Encapsulates poly, typical poly, followed by FlatInstrument record */
  3124.     kGeneralEventPartName        = 4,                            /* Brackets 2 longs follwed by a pascal string (padded to long alignment) */
  3125.     kGeneralEventPartKey        = 5                                /* Brackets 2 longs */
  3126. };
  3127.  
  3128.  
  3129. enum {
  3130.     TCSourceRefNameType            = 'name'
  3131. };
  3132.  
  3133.  
  3134. enum {
  3135.     tcDropFrame                    = 1 << 0,
  3136.     tc24HourMax                    = 1 << 1,
  3137.     tcNegTimesOK                = 1 << 2,
  3138.     tcCounter                    = 1 << 3
  3139. };
  3140.  
  3141. struct TimeCodeDef {
  3142.     long                             flags;                        /* drop-frame, etc.*/
  3143.     TimeScale                         fTimeScale;                    /* time scale of frameDuration (eg. 2997)*/
  3144.     TimeValue                         frameDuration;                /* duration of each frame (eg. 100)*/
  3145.     UInt8                             numFrames;                    /* frames/sec for timecode (eg. 30) OR frames/tick for counter mode*/
  3146.     UInt8                             padding;                    /* unused padding byte*/
  3147. };
  3148. typedef struct TimeCodeDef TimeCodeDef;
  3149.  
  3150.  
  3151. enum {
  3152.     tctNegFlag                    = 0x80                            /* negative bit is in minutes*/
  3153. };
  3154.  
  3155. struct TimeCodeTime {
  3156.     UInt8                             hours;
  3157.     UInt8                             minutes;
  3158.     UInt8                             seconds;
  3159.     UInt8                             frames;
  3160. };
  3161. typedef struct TimeCodeTime TimeCodeTime;
  3162.  
  3163. struct TimeCodeCounter {
  3164.     long                             counter;
  3165. };
  3166. typedef struct TimeCodeCounter TimeCodeCounter;
  3167.  
  3168. union TimeCodeRecord {
  3169.     TimeCodeTime                     t;
  3170.     TimeCodeCounter                 c;
  3171. };
  3172. typedef union TimeCodeRecord TimeCodeRecord;
  3173.  
  3174. struct TimeCodeDescription {
  3175.     long                             descSize;                    /* standard sample description header*/
  3176.     long                             dataFormat;
  3177.     long                             resvd1;
  3178.     short                             resvd2;
  3179.     short                             dataRefIndex;
  3180.     long                             flags;                        /* timecode specific stuff*/
  3181.     TimeCodeDef                     timeCodeDef;
  3182.     long                             srcRef[1];
  3183. };
  3184. typedef struct TimeCodeDescription TimeCodeDescription;
  3185.  
  3186. typedef TimeCodeDescription *TimeCodeDescriptionPtr;
  3187. typedef TimeCodeDescriptionPtr *TimeCodeDescriptionHandle;
  3188.  
  3189. enum {
  3190.     tcdfShowTimeCode            = 1 << 0
  3191. };
  3192.  
  3193.  
  3194. enum {
  3195.     kTCGetCurrentTimeCodeSelect    = 257,
  3196.     kTCGetTimeCodeAtTimeSelect    = 258,
  3197.     kTCTimeCodeToStringSelect    = 259,
  3198.     kTCTimeCodeToFrameNumberSelect = 260,
  3199.     kTCFrameNumberToTimeCodeSelect = 261,
  3200.     kTCGetSourceRefSelect        = 262,
  3201.     kTCSetSourceRefSelect        = 263,
  3202.     kTCSetTimeCodeFlagsSelect    = 264,
  3203.     kTCGetTimeCodeFlagsSelect    = 265,
  3204.     kTCSetDisplayOptionsSelect    = 266,
  3205.     kTCGetDisplayOptionsSelect    = 267
  3206. };
  3207.  
  3208. struct TCTextOptions {
  3209.     short                             txFont;
  3210.     short                             txFace;
  3211.     short                             txSize;
  3212.     RGBColor                         foreColor;
  3213.     RGBColor                         backColor;
  3214. };
  3215. typedef struct TCTextOptions TCTextOptions;
  3216.  
  3217. typedef TCTextOptions *TCTextOptionsPtr;
  3218. extern pascal HandlerError TCGetCurrentTimeCode(MediaHandler mh, long *frameNum, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, UserData *srcRefH)
  3219.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0101, 0x7000, 0xA82A);
  3220.  
  3221. extern pascal HandlerError TCGetTimeCodeAtTime(MediaHandler mh, TimeValue mediaTime, long *frameNum, TimeCodeDef *tcdef, TimeCodeRecord *tcdata, UserData *srcRefH)
  3222.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0102, 0x7000, 0xA82A);
  3223.  
  3224. extern pascal HandlerError TCTimeCodeToFrameNumber(MediaHandler mh, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, long *frameNumber)
  3225.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0104, 0x7000, 0xA82A);
  3226.  
  3227. extern pascal HandlerError TCFrameNumberToTimeCode(MediaHandler mh, long frameNumber, TimeCodeDef *tcdef, TimeCodeRecord *tcrec)
  3228.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0105, 0x7000, 0xA82A);
  3229.  
  3230. extern pascal HandlerError TCTimeCodeToString(MediaHandler mh, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, StringPtr tcStr)
  3231.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  3232.  
  3233. extern pascal HandlerError TCGetSourceRef(MediaHandler mh, TimeCodeDescriptionHandle tcdH, UserData *srefH)
  3234.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0106, 0x7000, 0xA82A);
  3235.  
  3236. extern pascal HandlerError TCSetSourceRef(MediaHandler mh, TimeCodeDescriptionHandle tcdH, UserData srefH)
  3237.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0107, 0x7000, 0xA82A);
  3238.  
  3239. extern pascal HandlerError TCSetTimeCodeFlags(MediaHandler mh, long flags, long flagsMask)
  3240.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0108, 0x7000, 0xA82A);
  3241.  
  3242. extern pascal HandlerError TCGetTimeCodeFlags(MediaHandler mh, long *flags)
  3243.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0109, 0x7000, 0xA82A);
  3244.  
  3245. extern pascal HandlerError TCSetDisplayOptions(MediaHandler mh, TCTextOptionsPtr textOptions)
  3246.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x010A, 0x7000, 0xA82A);
  3247.  
  3248. extern pascal HandlerError TCGetDisplayOptions(MediaHandler mh, TCTextOptionsPtr textOptions)
  3249.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x010B, 0x7000, 0xA82A);
  3250.  
  3251. /* UPP call backs */
  3252.  
  3253. #if GENERATINGCFM
  3254. #else
  3255. #endif
  3256.  
  3257. enum {
  3258.     uppSGDataProcInfo = kPascalStackBased
  3259.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  3260.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3261.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  3262.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  3263.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long *)))
  3264.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  3265.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(TimeValue)))
  3266.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(short)))
  3267.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long))),
  3268.     uppSGModalFilterProcInfo = kPascalStackBased
  3269.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3270.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  3271.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord *)))
  3272.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *)))
  3273.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  3274.     uppSGGrabProcInfo = kPascalStackBased
  3275.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3276.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3277.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3278.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  3279.     uppSGGrabCompleteProcInfo = kPascalStackBased
  3280.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3281.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3282.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3283.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean *)))
  3284.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  3285.     uppSGDisplayProcInfo = kPascalStackBased
  3286.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3287.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3288.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3289.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MatrixRecord *)))
  3290.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  3291.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  3292.     uppSGCompressProcInfo = kPascalStackBased
  3293.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3294.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3295.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3296.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  3297.     uppSGCompressCompleteProcInfo = kPascalStackBased
  3298.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3299.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3300.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3301.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean *)))
  3302.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SGCompressInfo *)))
  3303.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  3304.     uppSGAddFrameProcInfo = kPascalStackBased
  3305.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3306.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3307.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3308.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TimeValue)))
  3309.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(TimeScale)))
  3310.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const SGCompressInfo *)))
  3311.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long))),
  3312.     uppSGTransferFrameProcInfo = kPascalStackBased
  3313.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3314.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3315.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3316.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MatrixRecord *)))
  3317.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  3318.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  3319.     uppSGGrabCompressCompleteProcInfo = kPascalStackBased
  3320.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3321.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3322.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean *)))
  3323.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(SGCompressInfo *)))
  3324.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(TimeRecord *)))
  3325.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  3326.     uppSGDisplayCompressProcInfo = kPascalStackBased
  3327.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3328.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  3329.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  3330.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ImageDescriptionHandle)))
  3331.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(MatrixRecord *)))
  3332.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(RgnHandle)))
  3333.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long))),
  3334.     uppVdigIntProcInfo = kPascalStackBased
  3335.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3336.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  3337.     uppSCModalFilterProcInfo = kPascalStackBased
  3338.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3339.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  3340.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord *)))
  3341.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *)))
  3342.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  3343.     uppSCModalHookProcInfo = kPascalStackBased
  3344.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  3345.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  3346.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  3347.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
  3348.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  3349.     uppDataHCompletionProcInfo = kPascalStackBased
  3350.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  3351.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  3352.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(OSErr))),
  3353.     uppMusicMIDISendProcInfo = kPascalStackBased
  3354.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3355.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicComponent)))
  3356.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  3357.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MusicMIDIPacket *))),
  3358.     uppMusicMIDIReadHookProcInfo = kPascalStackBased
  3359.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  3360.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicMIDIPacket *)))
  3361.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  3362.     uppTuneCallBackProcInfo = kPascalStackBased
  3363.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const TuneStatus *)))
  3364.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  3365.     uppTunePlayCallBackProcInfo = kPascalStackBased
  3366.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned long *)))
  3367.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  3368.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  3369. };
  3370.  
  3371. #if GENERATINGCFM
  3372. #define NewSGDataProc(userRoutine)        \
  3373.         (SGDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDataProcInfo, GetCurrentArchitecture())
  3374. #define NewSGModalFilterProc(userRoutine)        \
  3375.         (SGModalFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGModalFilterProcInfo, GetCurrentArchitecture())
  3376. #define NewSGGrabProc(userRoutine)        \
  3377.         (SGGrabUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabProcInfo, GetCurrentArchitecture())
  3378. #define NewSGGrabCompleteProc(userRoutine)        \
  3379.         (SGGrabCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabCompleteProcInfo, GetCurrentArchitecture())
  3380. #define NewSGDisplayProc(userRoutine)        \
  3381.         (SGDisplayUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDisplayProcInfo, GetCurrentArchitecture())
  3382. #define NewSGCompressProc(userRoutine)        \
  3383.         (SGCompressUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGCompressProcInfo, GetCurrentArchitecture())
  3384. #define NewSGCompressCompleteProc(userRoutine)        \
  3385.         (SGCompressCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGCompressCompleteProcInfo, GetCurrentArchitecture())
  3386. #define NewSGAddFrameProc(userRoutine)        \
  3387.         (SGAddFrameUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGAddFrameProcInfo, GetCurrentArchitecture())
  3388. #define NewSGTransferFrameProc(userRoutine)        \
  3389.         (SGTransferFrameUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGTransferFrameProcInfo, GetCurrentArchitecture())
  3390. #define NewSGGrabCompressCompleteProc(userRoutine)        \
  3391.         (SGGrabCompressCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabCompressCompleteProcInfo, GetCurrentArchitecture())
  3392. #define NewSGDisplayCompressProc(userRoutine)        \
  3393.         (SGDisplayCompressUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDisplayCompressProcInfo, GetCurrentArchitecture())
  3394. #define NewVdigIntProc(userRoutine)        \
  3395.         (VdigIntUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppVdigIntProcInfo, GetCurrentArchitecture())
  3396. #define NewSCModalFilterProc(userRoutine)        \
  3397.         (SCModalFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSCModalFilterProcInfo, GetCurrentArchitecture())
  3398. #define NewSCModalHookProc(userRoutine)        \
  3399.         (SCModalHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSCModalHookProcInfo, GetCurrentArchitecture())
  3400. #define NewDataHCompletionProc(userRoutine)        \
  3401.         (DataHCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDataHCompletionProcInfo, GetCurrentArchitecture())
  3402. #define NewMusicMIDISendProc(userRoutine)        \
  3403.         (MusicMIDISendUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  3404. #define NewMusicMIDIReadHookProc(userRoutine)        \
  3405.         (MusicMIDIReadHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  3406. #define NewTuneCallBackProc(userRoutine)        \
  3407.         (TuneCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  3408. #define NewTunePlayCallBackProc(userRoutine)        \
  3409.         (TunePlayCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  3410. #else
  3411. #define NewSGDataProc(userRoutine)        \
  3412.         ((SGDataUPP) (userRoutine))
  3413. #define NewSGModalFilterProc(userRoutine)        \
  3414.         ((SGModalFilterUPP) (userRoutine))
  3415. #define NewSGGrabProc(userRoutine)        \
  3416.         ((SGGrabUPP) (userRoutine))
  3417. #define NewSGGrabCompleteProc(userRoutine)        \
  3418.         ((SGGrabCompleteUPP) (userRoutine))
  3419. #define NewSGDisplayProc(userRoutine)        \
  3420.         ((SGDisplayUPP) (userRoutine))
  3421. #define NewSGCompressProc(userRoutine)        \
  3422.         ((SGCompressUPP) (userRoutine))
  3423. #define NewSGCompressCompleteProc(userRoutine)        \
  3424.         ((SGCompressCompleteUPP) (userRoutine))
  3425. #define NewSGAddFrameProc(userRoutine)        \
  3426.         ((SGAddFrameUPP) (userRoutine))
  3427. #define NewSGTransferFrameProc(userRoutine)        \
  3428.         ((SGTransferFrameUPP) (userRoutine))
  3429. #define NewSGGrabCompressCompleteProc(userRoutine)        \
  3430.         ((SGGrabCompressCompleteUPP) (userRoutine))
  3431. #define NewSGDisplayCompressProc(userRoutine)        \
  3432.         ((SGDisplayCompressUPP) (userRoutine))
  3433. #define NewVdigIntProc(userRoutine)        \
  3434.         ((VdigIntUPP) (userRoutine))
  3435. #define NewSCModalFilterProc(userRoutine)        \
  3436.         ((SCModalFilterUPP) (userRoutine))
  3437. #define NewSCModalHookProc(userRoutine)        \
  3438.         ((SCModalHookUPP) (userRoutine))
  3439. #define NewDataHCompletionProc(userRoutine)        \
  3440.         ((DataHCompletionUPP) (userRoutine))
  3441. #define NewMusicMIDISendProc(userRoutine)        \
  3442.         ((MusicMIDISendUPP) (userRoutine))
  3443. #define NewMusicMIDIReadHookProc(userRoutine)        \
  3444.         ((MusicMIDIReadHookUPP) (userRoutine))
  3445. #define NewTuneCallBackProc(userRoutine)        \
  3446.         ((TuneCallBackUPP) (userRoutine))
  3447. #define NewTunePlayCallBackProc(userRoutine)        \
  3448.         ((TunePlayCallBackUPP) (userRoutine))
  3449. #endif
  3450.  
  3451. #if GENERATINGCFM
  3452. #define CallSGDataProc(userRoutine, c, p, len, offset, chRefCon, time, writeType, refCon)        \
  3453.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDataProcInfo, (c), (p), (len), (offset), (chRefCon), (time), (writeType), (refCon))
  3454. #define CallSGModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refCon)        \
  3455.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGModalFilterProcInfo, (theDialog), (theEvent), (itemHit), (refCon))
  3456. #define CallSGGrabProc(userRoutine, c, bufferNum, refCon)        \
  3457.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabProcInfo, (c), (bufferNum), (refCon))
  3458. #define CallSGGrabCompleteProc(userRoutine, c, bufferNum, done, refCon)        \
  3459.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabCompleteProcInfo, (c), (bufferNum), (done), (refCon))
  3460. #define CallSGDisplayProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  3461.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDisplayProcInfo, (c), (bufferNum), (mp), (clipRgn), (refCon))
  3462. #define CallSGCompressProc(userRoutine, c, bufferNum, refCon)        \
  3463.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGCompressProcInfo, (c), (bufferNum), (refCon))
  3464. #define CallSGCompressCompleteProc(userRoutine, c, bufferNum, done, ci, refCon)        \
  3465.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGCompressCompleteProcInfo, (c), (bufferNum), (done), (ci), (refCon))
  3466. #define CallSGAddFrameProc(userRoutine, c, bufferNum, atTime, scale, ci, refCon)        \
  3467.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGAddFrameProcInfo, (c), (bufferNum), (atTime), (scale), (ci), (refCon))
  3468. #define CallSGTransferFrameProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  3469.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGTransferFrameProcInfo, (c), (bufferNum), (mp), (clipRgn), (refCon))
  3470. #define CallSGGrabCompressCompleteProc(userRoutine, c, done, ci, t, refCon)        \
  3471.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabCompressCompleteProcInfo, (c), (done), (ci), (t), (refCon))
  3472. #define CallSGDisplayCompressProc(userRoutine, c, dataPtr, desc, mp, clipRgn, refCon)        \
  3473.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDisplayCompressProcInfo, (c), (dataPtr), (desc), (mp), (clipRgn), (refCon))
  3474. #define CallVdigIntProc(userRoutine, flags, refcon)        \
  3475.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppVdigIntProcInfo, (flags), (refcon))
  3476. #define CallSCModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refcon)        \
  3477.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSCModalFilterProcInfo, (theDialog), (theEvent), (itemHit), (refcon))
  3478. #define CallSCModalHookProc(userRoutine, theDialog, itemHit, params, refcon)        \
  3479.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSCModalHookProcInfo, (theDialog), (itemHit), (params), (refcon))
  3480. #define CallDataHCompletionProc(userRoutine, request, refcon, err)        \
  3481.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDataHCompletionProcInfo, (request), (refcon), (err))
  3482. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  3483.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  3484. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  3485.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  3486. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  3487.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  3488. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  3489.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  3490. #else
  3491. #define CallSGDataProc(userRoutine, c, p, len, offset, chRefCon, time, writeType, refCon)        \
  3492.         (*(userRoutine))((c), (p), (len), (offset), (chRefCon), (time), (writeType), (refCon))
  3493. #define CallSGModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refCon)        \
  3494.         (*(userRoutine))((theDialog), (theEvent), (itemHit), (refCon))
  3495. #define CallSGGrabProc(userRoutine, c, bufferNum, refCon)        \
  3496.         (*(userRoutine))((c), (bufferNum), (refCon))
  3497. #define CallSGGrabCompleteProc(userRoutine, c, bufferNum, done, refCon)        \
  3498.         (*(userRoutine))((c), (bufferNum), (done), (refCon))
  3499. #define CallSGDisplayProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  3500.         (*(userRoutine))((c), (bufferNum), (mp), (clipRgn), (refCon))
  3501. #define CallSGCompressProc(userRoutine, c, bufferNum, refCon)        \
  3502.         (*(userRoutine))((c), (bufferNum), (refCon))
  3503. #define CallSGCompressCompleteProc(userRoutine, c, bufferNum, done, ci, refCon)        \
  3504.         (*(userRoutine))((c), (bufferNum), (done), (ci), (refCon))
  3505. #define CallSGAddFrameProc(userRoutine, c, bufferNum, atTime, scale, ci, refCon)        \
  3506.         (*(userRoutine))((c), (bufferNum), (atTime), (scale), (ci), (refCon))
  3507. #define CallSGTransferFrameProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  3508.         (*(userRoutine))((c), (bufferNum), (mp), (clipRgn), (refCon))
  3509. #define CallSGGrabCompressCompleteProc(userRoutine, c, done, ci, t, refCon)        \
  3510.         (*(userRoutine))((c), (done), (ci), (t), (refCon))
  3511. #define CallSGDisplayCompressProc(userRoutine, c, dataPtr, desc, mp, clipRgn, refCon)        \
  3512.         (*(userRoutine))((c), (dataPtr), (desc), (mp), (clipRgn), (refCon))
  3513. #define CallVdigIntProc(userRoutine, flags, refcon)        \
  3514.         (*(userRoutine))((flags), (refcon))
  3515. #define CallSCModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refcon)        \
  3516.         (*(userRoutine))((theDialog), (theEvent), (itemHit), (refcon))
  3517. #define CallSCModalHookProc(userRoutine, theDialog, itemHit, params, refcon)        \
  3518.         (*(userRoutine))((theDialog), (itemHit), (params), (refcon))
  3519. #define CallDataHCompletionProc(userRoutine, request, refcon, err)        \
  3520.         (*(userRoutine))((request), (refcon), (err))
  3521. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  3522.         (*(userRoutine))((self), (refCon), (mmp))
  3523. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  3524.         (*(userRoutine))((mp), (myRefCon))
  3525. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  3526.         (*(userRoutine))((status), (refCon))
  3527. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  3528.         (*(userRoutine))((event), (seed), (refCon))
  3529. #endif
  3530. #endif
  3531.  
  3532. #if PRAGMA_ALIGN_SUPPORTED
  3533. #pragma options align=reset
  3534. #endif
  3535.  
  3536. #if PRAGMA_IMPORT_SUPPORTED
  3537. #pragma import off
  3538. #endif
  3539.  
  3540. #ifdef __cplusplus
  3541. }
  3542. #endif
  3543.  
  3544. #endif /* __QUICKTIMECOMPONENTS__ */
  3545.  
  3546.